diff options
-rw-r--r-- | plumbing/object/commit_walker_file.go | 5 | ||||
-rw-r--r-- | repository_test.go | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/plumbing/object/commit_walker_file.go b/plumbing/object/commit_walker_file.go index 6f16e61..76c158b 100644 --- a/plumbing/object/commit_walker_file.go +++ b/plumbing/object/commit_walker_file.go @@ -128,7 +128,9 @@ func isParentHash(hash plumbing.Hash, commit *Commit) bool { func (c *commitFileIter) ForEach(cb func(*Commit) error) error { for { commit, nextErr := c.Next() - if nextErr != nil { + if nextErr == io.EOF { + break + } else if nextErr != nil { return nextErr } err := cb(commit) @@ -138,6 +140,7 @@ func (c *commitFileIter) ForEach(cb func(*Commit) error) error { return err } } + return nil } func (c *commitFileIter) Close() { diff --git a/repository_test.go b/repository_test.go index d7450c4..0e46ded 100644 --- a/repository_test.go +++ b/repository_test.go @@ -13,7 +13,6 @@ import ( "testing" "time" - fixtures "gopkg.in/src-d/go-git-fixtures.v3" "golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp/armor" @@ -33,6 +32,7 @@ import ( "gopkg.in/src-d/go-billy.v4/memfs" "gopkg.in/src-d/go-billy.v4/osfs" "gopkg.in/src-d/go-billy.v4/util" + "gopkg.in/src-d/go-git-fixtures.v3" ) type RepositorySuite struct { |