aboutsummaryrefslogtreecommitdiffstats
path: root/examples/remotes
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 16:24:07 +0100
committerGitHub <noreply@github.com>2017-01-30 16:24:07 +0100
commita24e40af0aa2d9d512051269993a1b08c0496d12 (patch)
tree65936a6a365263c93e4b57c3b67aad6a13489e68 /examples/remotes
parenta48bc6e17ef6298f93ec21cdf1a5e387640673b6 (diff)
parent35378e7db9288e8244f2634a1b47981606731cef (diff)
downloadgo-git-a24e40af0aa2d9d512051269993a1b08c0496d12.tar.gz
Merge pull request #229 from mcuadros/worktree
Worktree and new Repository Contructors
Diffstat (limited to 'examples/remotes')
-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",
})