aboutsummaryrefslogtreecommitdiffstats
path: root/examples/remotes/main.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-29 02:27:16 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2017-01-29 22:36:15 +0100
commitacb1dc80d93f45a055b14903679abca3a6e994f6 (patch)
treea7e29fd677bb5c11df85fca1fcb6d015bc40fa7b /examples/remotes/main.go
parent352170d1bf8cc7b32b85d8a2740eb3627e952a6e (diff)
downloadgo-git-acb1dc80d93f45a055b14903679abca3a6e994f6.tar.gz
example: using new constructors
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",
})