aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc.go45
1 files changed, 23 insertions, 22 deletions
diff --git a/doc.go b/doc.go
index e9d51c2..8d00689 100644
--- a/doc.go
+++ b/doc.go
@@ -6,30 +6,31 @@
// extensions.
//
// Small example extracting the commits from a repository:
-// func ExampleBasic_printCommits() {
-// r, err := git.NewRepository("https://github.com/src-d/go-git", nil)
-// if err != nil {
-// panic(err)
-// }
+// func ExampleBasic_printCommits() {
+// r := git.NewMemoryRepository()
+// o := &git.CloneOptions{
+// URL: "https://github.com/src-d/go-git",
+// }
+// if err := r.Clone(o); err != nil {
+// panic(err)
+// }
//
-// if err := r.Pull("origin", "refs/heads/master"); err != nil {
-// panic(err)
-// }
+// iter, err := r.Commits()
+// if err != nil {
+// panic(err)
+// }
+// defer iter.Close()
//
-// iter := r.Commits()
-// defer iter.Close()
+// for {
+// commit, err := iter.Next()
+// if err != nil {
+// if err == io.EOF {
+// break
+// }
+// panic(err)
+// }
//
-// for {
-// commit, err := iter.Next()
-// if err != nil {
-// if err == io.EOF {
-// break
-// }
-//
-// panic(err)
-// }
-//
-// fmt.Println(commit)
-// }
+// fmt.Println(commit)
// }
+// }
package git // import "gopkg.in/src-d/go-git.v4"