From bcb49927a3897eadc29960032c70da29e26d6b58 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Mon, 15 Aug 2016 03:51:04 +0200 Subject: Repository.Clone and Remote.Fetch remote, local branches and client: correct header read --- examples/basic/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'examples/basic') 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) } -- cgit