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 }
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 }