aboutsummaryrefslogtreecommitdiffstats
path: root/_examples/showcase/main.go
diff options
context:
space:
mode:
Diffstat (limited to '_examples/showcase/main.go')
-rw-r--r--_examples/showcase/main.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/_examples/showcase/main.go b/_examples/showcase/main.go
index 0170cd8..aeeddb8 100644
--- a/_examples/showcase/main.go
+++ b/_examples/showcase/main.go
@@ -59,12 +59,15 @@ func main() {
// List the history of the repository
Info("git log --oneline")
- commits, err := commit.History()
+ commitIter, err := r.Log(&git.LogOptions{From: commit.Hash})
CheckIfError(err)
- for _, c := range commits {
+ err = commitIter.ForEach(func(c *object.Commit) error {
hash := c.Hash.String()
line := strings.Split(c.Message, "\n")
fmt.Println(hash[:7], line[0])
- }
+
+ return nil
+ })
+ CheckIfError(err)
}