示例#1
0
文件: branch.go 项目: jezell/git2go
func (b *Branch) Upstream() (*Reference, error) {

	var ptr *C.git_reference
	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_branch_upstream(&ptr, b.Reference.ptr)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}
	return newReferenceFromC(ptr, b.repo), nil
}
示例#2
0
文件: branch.go 项目: jingweno/git2go
func (b *Branch) Upstream() (*Branch, error) {
	upstream := new(Branch)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_branch_upstream(&upstream.ptr, b.ptr)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}
	return upstream, nil
}