aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2019-08-04 17:46:36 +0200
committerGitHub <noreply@github.com>2019-08-04 17:46:36 +0200
commit6f354807f63e3479e41e56d72866291eeac9251e (patch)
tree1977bca41aa85e2c57bf48f6c6001ebeec33204b /plumbing
parent0d1a009cbb604db18be960db5f1525b99a55d727 (diff)
parenta2af865f9dbf292a9804c67abc2727551f7954dd (diff)
downloadgo-git-6f354807f63e3479e41e56d72866291eeac9251e.tar.gz
Merge pull request #1204 from knqyf263/fix/handle_eof_err
Handle EOF error in commitFileIter.ForEach
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/object/commit_walker_file.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/plumbing/object/commit_walker_file.go b/plumbing/object/commit_walker_file.go
index 6f16e61..b73e4ce 100644
--- a/plumbing/object/commit_walker_file.go
+++ b/plumbing/object/commit_walker_file.go
@@ -128,6 +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 == io.EOF {
+ break
+ }
if nextErr != nil {
return nextErr
}
@@ -138,6 +141,7 @@ func (c *commitFileIter) ForEach(cb func(*Commit) error) error {
return err
}
}
+ return nil
}
func (c *commitFileIter) Close() {