func (v *Repository) RevparseSingle(spec string) (Object, error) { cspec := C.CString(spec) defer C.free(unsafe.Pointer(cspec)) var ptr *C.git_object ecode := C.git_revparse_single(&ptr, v.ptr, cspec) if ecode < 0 { return nil, LastError() } return allocObject(ptr), nil }
func (v *Repository) RevparseSingle(spec string) (*Object, error) { cspec := C.CString(spec) defer C.free(unsafe.Pointer(cspec)) var ptr *C.git_object runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_revparse_single(&ptr, v.ptr, cspec) if ecode < 0 { return nil, MakeGitError(ecode) } return allocObject(ptr, v), nil }