示例#1
0
文件: merge.go 项目: jgrocho/go-git2
func (repo *Repository) MergeBase(one, two Oid) (*Oid, error) {
	oid := new(Oid)
	ecode := C.git_merge_base(oid.git_oid, repo.git_repository, one.git_oid, two.git_oid)
	if ecode != git_SUCCESS {
		return nil, gitError()
	}
	return oid, nil
}
示例#2
0
func (r *Repository) MergeBase(one *Oid, two *Oid) (*Oid, error) {
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	var oid C.git_oid
	ret := C.git_merge_base(&oid, r.ptr, one.toC(), two.toC())
	if ret < 0 {
		return nil, MakeGitError(ret)
	}
	return newOidFromC(&oid), nil
}