From efef1479b7948e4f9f310446cfdf360f2cb09596 Mon Sep 17 00:00:00 2001 From: Antonio Jesus Navarro Perez Date: Mon, 10 Apr 2017 17:00:27 +0200 Subject: Modify examples --- _examples/showcase/main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to '_examples/showcase') 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) } -- cgit