diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-15 03:51:04 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-08-15 03:51:04 +0200 |
commit | bcb49927a3897eadc29960032c70da29e26d6b58 (patch) | |
tree | 60025a0a59d15e49c6027b1bfd5d6fee5d5d2438 /examples | |
parent | f6fe29c80d11662a169806dcf413ecdedcb28fa3 (diff) | |
download | go-git-bcb49927a3897eadc29960032c70da29e26d6b58.tar.gz |
Repository.Clone and Remote.Fetch remote, local branches and client: correct header read
Diffstat (limited to 'examples')
-rw-r--r-- | examples/basic/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/basic/main.go b/examples/basic/main.go index fd7f82e..e13b5d9 100644 --- a/examples/basic/main.go +++ b/examples/basic/main.go @@ -16,7 +16,7 @@ func main() { panic(err) } - if err = r.Clone(&git.CloneOptions{URL: url}); err != nil { + if err = r.Clone(&git.RepositoryCloneOptions{URL: url, Depth: 1, SingleBranch: false}); err != nil { panic(err) } @@ -24,8 +24,10 @@ func main() { if err != nil { panic(err) } + defer iter.Close() + var count = 0 for { //the commits are not shorted in any special order commit, err := iter.Next() @@ -37,6 +39,9 @@ func main() { panic(err) } + count++ fmt.Println(commit) } + + fmt.Println("total commits:", count) } |