MCPcopy Create free account
hub / github.com/libgit2/git2go / RevparseSingle

Method RevparseSingle

revparse.go:77–92  ·  view source on GitHub ↗
(spec string)

Source from the content-addressed store, hash-verified

75}
76
77func (v *Repository) RevparseSingle(spec string) (*Object, error) {
78 cspec := C.CString(spec)
79 defer C.free(unsafe.Pointer(cspec))
80
81 var ptr *C.git_object
82
83 runtime.LockOSThread()
84 defer runtime.UnlockOSThread()
85
86 ecode := C.git_revparse_single(&ptr, v.ptr, cspec)
87 if ecode < 0 {
88 return nil, MakeGitError(ecode)
89 }
90
91 return allocObject(ptr, v), nil
92}
93
94func (r *Repository) RevparseExt(spec string) (*Object, *Reference, error) {
95 cspec := C.CString(spec)

Callers 2

TestRevparseSingleFunction · 0.80
TestObjectPoymorphismFunction · 0.80

Calls 3

MakeGitErrorFunction · 0.85
allocObjectFunction · 0.85
freeMethod · 0.80

Tested by 2

TestRevparseSingleFunction · 0.64
TestObjectPoymorphismFunction · 0.64