diff options
author | knqyf263 <knqyf263@gmail.com> | 2019-08-03 16:02:48 -1000 |
---|---|---|
committer | knqyf263 <knqyf263@gmail.com> | 2019-08-03 17:08:34 -1000 |
commit | d7c00b034ff5ce038c168ab16a943cc5f55aac3c (patch) | |
tree | fa915c534bd90a5e3886f948c6b9755ae244c15b /plumbing/object | |
parent | 0373247790c1dd490f6756697c9d89bed9f7c4bb (diff) | |
download | go-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.go | 5 |
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() { |