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

Method LookupAnnotatedCommit

merge.go:67–81  ·  view source on GitHub ↗
(oid *Oid)

Source from the content-addressed store, hash-verified

65}
66
67func (r *Repository) LookupAnnotatedCommit(oid *Oid) (*AnnotatedCommit, error) {
68 runtime.LockOSThread()
69 defer runtime.UnlockOSThread()
70
71 var ptr *C.git_annotated_commit
72 ret := C.git_annotated_commit_lookup(&ptr, r.ptr, oid.toC())
73 runtime.KeepAlive(oid)
74 if ret < 0 {
75 return nil, MakeGitError(ret)
76 }
77
78 annotatedCommit := newAnnotatedCommitFromC(ptr, r)
79 runtime.KeepAlive(r)
80 return annotatedCommit, nil
81}
82
83func (r *Repository) AnnotatedCommitFromRef(ref *Reference) (*AnnotatedCommit, error) {
84 runtime.LockOSThread()

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
newAnnotatedCommitFromCFunction · 0.85
toCMethod · 0.45

Tested by

no test coverage detected