aboutsummaryrefslogtreecommitdiffstats
path: root/examples/log
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/log
parent352170d1bf8cc7b32b85d8a2740eb3627e952a6e (diff)
downloadgo-git-acb1dc80d93f45a055b14903679abca3a6e994f6.tar.gz
example: using new constructors
Diffstat (limited to 'examples/log')
-rw-r--r--examples/log/main.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/examples/log/main.go b/examples/log/main.go
index 6ab0bb7..eb41010 100644
--- a/examples/log/main.go
+++ b/examples/log/main.go
@@ -5,17 +5,14 @@ import (
"gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/examples"
+ "gopkg.in/src-d/go-git.v4/storage/memory"
)
func main() {
- // Instances an in-memory git repository
- r := git.NewMemoryRepository()
-
// Clones the given repository, creating the remote, the local branches
- // and fetching the objects, exactly as:
+ // and fetching the objects, everything in memory:
Info("git clone https://github.com/src-d/go-siva")
-
- err := r.Clone(&git.CloneOptions{URL: "https://github.com/src-d/go-siva"})
+ r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{URL: "https://github.com/src-d/go-siva"})
CheckIfError(err)
// Gets the HEAD history from HEAD, just like does: