Esempio n. 1
0
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()
}
Esempio n. 2
0
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
}
Esempio n. 3
0
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
}
Esempio n. 4
0
//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
}