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

Method MergeBase

merge.go:307–320  ·  view source on GitHub ↗
(one *Oid, two *Oid)

Source from the content-addressed store, hash-verified

305}
306
307func (r *Repository) MergeBase(one *Oid, two *Oid) (*Oid, error) {
308 runtime.LockOSThread()
309 defer runtime.UnlockOSThread()
310
311 var oid C.git_oid
312 ret := C.git_merge_base(&oid, r.ptr, one.toC(), two.toC())
313 runtime.KeepAlive(one)
314 runtime.KeepAlive(two)
315 runtime.KeepAlive(r)
316 if ret < 0 {
317 return nil, MakeGitError(ret)
318 }
319 return newOidFromC(&oid), nil
320}
321
322// MergeBases retrieves the list of merge bases between two commits.
323//

Callers 1

TestMergeBaseFunction · 0.80

Calls 3

MakeGitErrorFunction · 0.85
newOidFromCFunction · 0.85
toCMethod · 0.45

Tested by 1

TestMergeBaseFunction · 0.64