diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2019-08-04 17:46:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-04 17:46:36 +0200 |
commit | 6f354807f63e3479e41e56d72866291eeac9251e (patch) | |
tree | 1977bca41aa85e2c57bf48f6c6001ebeec33204b /plumbing | |
parent | 0d1a009cbb604db18be960db5f1525b99a55d727 (diff) | |
parent | a2af865f9dbf292a9804c67abc2727551f7954dd (diff) | |
download | go-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.go | 4 |
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() { |