diff options
author | Antonio Jesus Navarro Perez <antonio@sourced.tech> | 2017-04-10 17:00:27 +0200 |
---|---|---|
committer | Antonio Jesus Navarro Perez <antonio@sourced.tech> | 2017-04-11 11:25:42 +0200 |
commit | efef1479b7948e4f9f310446cfdf360f2cb09596 (patch) | |
tree | 0e513815f1ef3765538c19b893ab4990264ae46d /_examples/showcase | |
parent | be8d19438ada078a8598e366ab74aa09e4c521cd (diff) | |
download | go-git-efef1479b7948e4f9f310446cfdf360f2cb09596.tar.gz |
Modify examples
Diffstat (limited to '_examples/showcase')
-rw-r--r-- | _examples/showcase/main.go | 9 |
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) } |