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

Method ShortId

object.go:60–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60func (o *Object) ShortId() (string, error) {
61 resultBuf := C.git_buf{}
62
63 runtime.LockOSThread()
64 defer runtime.UnlockOSThread()
65
66 ecode := C.git_object_short_id(&resultBuf, o.ptr)
67 runtime.KeepAlive(o)
68 if ecode < 0 {
69 return "", MakeGitError(ecode)
70 }
71 defer C.git_buf_dispose(&resultBuf)
72 return C.GoString(resultBuf.ptr), nil
73}
74
75func (o *Object) Type() ObjectType {
76 ret := ObjectType(C.git_object_type(o.ptr))

Callers 1

TestObjectShortIdFunction · 0.80

Calls 1

MakeGitErrorFunction · 0.85

Tested by 1

TestObjectShortIdFunction · 0.64