func (revwalk *Revwalk) Next() (*Oid, error) { oid := new(Oid) ecode := C.git_revwalk_next(oid.git_oid, revwalk.git_revwalk) if ecode == 0 { return oid, nil } else if ecode == git_REVWALKOVER { return nil, nil } return nil, gitError() }
func (v *RevWalk) Next(oid *Oid) (err error) { ret := C.git_revwalk_next(oid.toC(), v.ptr) switch { case ret == ITEROVER: err = io.EOF case ret < 0: err = LastError() } return }
func (v *RevWalk) Next(id *Oid) (err error) { runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_revwalk_next(id.toC(), v.ptr) switch { case ret < 0: err = MakeGitError(ret) } return }
//TODO: end of walk produces a LastError figure out how to reset it and return a os.EOF instead // possibly return a Oid? Would make for less boiler plate. func (v *RevWalk) Next(o *Oid) (err error) { if C.git_revwalk_next(o.git_oid, v.git_revwalk) < GIT_SUCCESS { return LastError() } return err }