aboutsummaryrefslogtreecommitdiffstats
path: root/examples/remotes/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'examples/remotes/main.go')
-rw-r--r--examples/remotes/main.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/remotes/main.go b/examples/remotes/main.go
index c0d71f5..6c9593a 100644
--- a/examples/remotes/main.go
+++ b/examples/remotes/main.go
@@ -7,17 +7,18 @@ import (
"gopkg.in/src-d/go-git.v4/config"
. "gopkg.in/src-d/go-git.v4/examples"
"gopkg.in/src-d/go-git.v4/plumbing"
+ "gopkg.in/src-d/go-git.v4/storage/memory"
)
func main() {
// Create a new repository
Info("git init")
- r := git.NewMemoryRepository()
+ r, err := git.Init(memory.NewStorage(), nil)
+ CheckIfError(err)
// Add a new remote, with the default fetch refspec
Info("git remote add example https://github.com/git-fixtures/basic.git")
-
- _, err := r.CreateRemote(&config.RemoteConfig{
+ _, err = r.CreateRemote(&config.RemoteConfig{
Name: "example",
URL: "https://github.com/git-fixtures/basic.git",
})