aboutsummaryrefslogtreecommitdiffstats
path: root/examples/basic/main.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-04-25 09:01:28 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-04-25 09:01:28 +0200
commitbcefb5bf829b841d9d12a27a06099b67c609b5f8 (patch)
tree273cad16130aa6cd05952e1aca88b9f41dc135c9 /examples/basic/main.go
parent74b8b53b28d444542edc77e0beec19bbab8e8037 (diff)
downloadgo-git-bcefb5bf829b841d9d12a27a06099b67c609b5f8.tar.gz
documentation
Diffstat (limited to 'examples/basic/main.go')
-rw-r--r--examples/basic/main.go11
1 files changed, 4 insertions, 7 deletions
diff --git a/examples/basic/main.go b/examples/basic/main.go
index 4b443b2..f5a1c8a 100644
--- a/examples/basic/main.go
+++ b/examples/basic/main.go
@@ -9,24 +9,21 @@ import (
)
func main() {
- fmt.Printf("Retrieving %q ...\n", os.Args[2])
- r, err := git.NewRepository(os.Args[2], nil)
+ fmt.Printf("Retrieving %q ...\n", os.Args[1])
+ r, err := git.NewRepository(os.Args[1], nil)
if err != nil {
panic(err)
}
- if err := r.Pull("origin", "refs/heads/master"); err != nil {
+ if err := r.PullDefault(); err != nil {
panic(err)
}
- dumpCommits(r)
-}
-
-func dumpCommits(r *git.Repository) {
iter := r.Commits()
defer iter.Close()
for {
+ //the commits are not shorted in any special order
commit, err := iter.Next()
if err != nil {
if err == io.EOF {