Beispiel #1
0
func (revwalk *Revwalk) PushRef(refname string) error {
	crefname := C.CString(refname)
	defer C.free(unsafe.Pointer(crefname))
	ecode := C.git_revwalk_push_ref(revwalk.git_revwalk, crefname)
	if ecode != git_SUCCESS {
		return gitError()
	}
	return nil
}
Beispiel #2
0
func (v *RevWalk) PushRef(r string) error {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	cstr := C.CString(r)
	defer C.free(unsafe.Pointer(cstr))

	ecode := C.git_revwalk_push_ref(v.ptr, cstr)
	if ecode < 0 {
		return MakeGitError(ecode)
	}
	return nil
}