summaryrefslogtreecommitdiff
path: root/walk.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-04-26 20:24:11 +0200
committerCarlos Martín Nieto <[email protected]>2014-04-26 20:24:11 +0200
commit3cf0b6db80885c63986001f3217019bdf2295b71 (patch)
treeab57488aea30266d689924ea23705a305a05103c /walk.go
parentdca2192492a63df11365e3fecd03281e174cb788 (diff)
parent8982f4b3be90a04b0fad24da1ee6d85b1caad336 (diff)
Merge pull request #80 from jezell/oid-parse-protection
make it possible to handle errors
Diffstat (limited to 'walk.go')
-rw-r--r--walk.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/walk.go b/walk.go
index f7c147d..9e07411 100644
--- a/walk.go
+++ b/walk.go
@@ -7,7 +7,6 @@ package git
import "C"
import (
- "io"
"runtime"
"unsafe"
)
@@ -158,8 +157,6 @@ func (v *RevWalk) Next(id *Oid) (err error) {
ret := C.git_revwalk_next(id.toC(), v.ptr)
switch {
- case ret == ITEROVER:
- err = io.EOF
case ret < 0:
err = MakeGitError(ret)
}
@@ -173,7 +170,7 @@ func (v *RevWalk) Iterate(fun RevWalkIterator) (err error) {
oid := new(Oid)
for {
err = v.Next(oid)
- if err == io.EOF {
+ if IsErrorCode(err, ErrIterOver) {
return nil
}
if err != nil {