aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object
diff options
context:
space:
mode:
authorknqyf263 <knqyf263@gmail.com>2019-08-03 16:02:48 -1000
committerknqyf263 <knqyf263@gmail.com>2019-08-03 17:08:34 -1000
commitd7c00b034ff5ce038c168ab16a943cc5f55aac3c (patch)
treefa915c534bd90a5e3886f948c6b9755ae244c15b /plumbing/object
parent0373247790c1dd490f6756697c9d89bed9f7c4bb (diff)
downloadgo-git-d7c00b034ff5ce038c168ab16a943cc5f55aac3c.tar.gz
Handle io.EOF error in commitFileIter.ForEach
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Diffstat (limited to 'plumbing/object')
-rw-r--r--plumbing/object/commit_walker_file.go5
1 files changed, 4 insertions, 1 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() {