aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-18 11:04:26 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-18 11:04:26 +0200
commit27d27020ba5f5b7b96d24454f6d09eaecfba6a76 (patch)
tree83e7ff3bfd85b56fbb7551ef3e3082832b410702
parent0ed8e180c604f8ff6d68fcaad081978a407e4653 (diff)
downloadgo-git-27d27020ba5f5b7b96d24454f6d09eaecfba6a76.tar.gz
examples: fix fs_implementation example
-rw-r--r--core/reference.go2
-rw-r--r--examples/fs_implementation/main.go9
2 files changed, 9 insertions, 2 deletions
diff --git a/core/reference.go b/core/reference.go
index 72bfe9d..5258146 100644
--- a/core/reference.go
+++ b/core/reference.go
@@ -237,7 +237,7 @@ const (
// <src> is the pattern for references on the remote side and <dst> is where
// those references will be written locally. The + tells Git to update the
// reference even if it isn’t a fast-forward.
-// eg.: "+refs/*/*:refs/remotes/origin/*"
+// eg.: "+refs/heads/*:refs/remotes/origin/*"
//
// https://git-scm.com/book/es/v2/Git-Internals-The-Refspec
type RefSpec string
diff --git a/examples/fs_implementation/main.go b/examples/fs_implementation/main.go
index a9bfbe6..626cc8a 100644
--- a/examples/fs_implementation/main.go
+++ b/examples/fs_implementation/main.go
@@ -9,6 +9,7 @@ import (
"strings"
"gopkg.in/src-d/go-git.v4"
+ "gopkg.in/src-d/go-git.v4/storage/filesystem"
"gopkg.in/src-d/go-git.v4/utils/fs"
)
@@ -20,7 +21,13 @@ func main() {
fs := NewCustomFS(os.Args[1])
- repo, err := git.NewFilesystemRepository(fs, ".git")
+ s, err := filesystem.NewStorage(fs, ".git")
+ if err != nil {
+ fmt.Fprint(os.Stderr, err)
+ os.Exit(1)
+ }
+
+ repo, err := git.NewRepository(s)
if err != nil {
fmt.Fprint(os.Stderr, err)
os.Exit(1)