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

Method AnnotatedCommitFromRef

merge.go:83–98  ·  view source on GitHub ↗
(ref *Reference)

Source from the content-addressed store, hash-verified

81}
82
83func (r *Repository) AnnotatedCommitFromRef(ref *Reference) (*AnnotatedCommit, error) {
84 runtime.LockOSThread()
85 defer runtime.UnlockOSThread()
86
87 var ptr *C.git_annotated_commit
88 ret := C.git_annotated_commit_from_ref(&ptr, r.ptr, ref.ptr)
89 runtime.KeepAlive(r)
90 runtime.KeepAlive(ref)
91 if ret < 0 {
92 return nil, MakeGitError(ret)
93 }
94
95 annotatedCommit := newAnnotatedCommitFromC(ptr, r)
96 runtime.KeepAlive(r)
97 return annotatedCommit, nil
98}
99
100func (r *Repository) AnnotatedCommitFromRevspec(spec string) (*AnnotatedCommit, error) {
101 crevspec := C.CString(spec)

Callers 4

performRebaseOntoFunction · 0.80
TestMergeWithSelfFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
newAnnotatedCommitFromCFunction · 0.85

Tested by 4

performRebaseOntoFunction · 0.64
TestMergeWithSelfFunction · 0.64