aboutsummaryrefslogtreecommitdiffstats
path: root/_examples
diff options
context:
space:
mode:
Diffstat (limited to '_examples')
-rw-r--r--_examples/log/main.go5
-rw-r--r--_examples/pull/main.go2
2 files changed, 5 insertions, 2 deletions
diff --git a/_examples/log/main.go b/_examples/log/main.go
index ba0597a..5807515 100644
--- a/_examples/log/main.go
+++ b/_examples/log/main.go
@@ -2,6 +2,7 @@ package main
import (
"fmt"
+ "time"
"gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/_examples"
@@ -31,7 +32,9 @@ func main() {
CheckIfError(err)
// ... retrieves the commit history
- cIter, err := r.Log(&git.LogOptions{From: ref.Hash()})
+ since := time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC)
+ until := time.Date(2019, 7, 30, 0, 0, 0, 0, time.UTC)
+ cIter, err := r.Log(&git.LogOptions{From: ref.Hash(), Since: &since, Until: &until})
CheckIfError(err)
// ... just iterates over the commits, printing it
diff --git a/_examples/pull/main.go b/_examples/pull/main.go
index 06369fa..6f258c8 100644
--- a/_examples/pull/main.go
+++ b/_examples/pull/main.go
@@ -13,7 +13,7 @@ func main() {
CheckArgs("<path>")
path := os.Args[1]
- // We instance\iate a new repository targeting the given path (the .git folder)
+ // We instantiate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
CheckIfError(err)