Пример #1
0
// Next retrieves the next reference. If the iterationis over, the
// returned error is git.ErrIterOver
func (v *ReferenceIterator) Next() (*Reference, error) {
	var ptr *C.git_reference
	ret := C.git_reference_next(&ptr, v.ptr)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}

	return newReferenceFromC(ptr, v.repo), nil
}
Пример #2
0
// Next retrieves the next reference name. If the iteration is over,
// the returned error is git.ErrIterOver
func (v *ReferenceIterator) Next() (string, error) {
	var ptr *C.char
	ret := C.git_reference_next(&ptr, v.ptr)
	if ret == ITEROVER {
		return "", ErrIterOver
	}
	if ret < 0 {
		return "", LastError()
	}

	return C.GoString(ptr), nil
}
Пример #3
0
// Next retrieves the next reference. If the iterationis over, the
// returned error is git.ErrIterOver
func (v *ReferenceIterator) Next() (*Reference, error) {
	var ptr *C.git_reference
	ret := C.git_reference_next(&ptr, v.ptr)
	if ret == ITEROVER {
		return nil, ErrIterOver
	}
	if ret < 0 {
		return nil, LastError()
	}

	return newReferenceFromC(ptr), nil
}