diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-04-11 21:28:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-11 21:28:19 +0200 |
commit | 9b45f468c61a0756dd19d09b64c2b1a88cc99ec5 (patch) | |
tree | 0e513815f1ef3765538c19b893ab4990264ae46d /_examples/showcase | |
parent | 3daede53835e8572b2957a016f068781db646567 (diff) | |
parent | efef1479b7948e4f9f310446cfdf360f2cb09596 (diff) | |
download | go-git-9b45f468c61a0756dd19d09b64c2b1a88cc99ec5.tar.gz |
Merge pull request #337 from ajnavarro/repository-log
Add Repository.Log() method (fix #298)
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) } |