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

Method Upstream

branch.go:233–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231}
232
233func (b *Branch) Upstream() (*Reference, error) {
234
235 var ptr *C.git_reference
236 runtime.LockOSThread()
237 defer runtime.UnlockOSThread()
238
239 ret := C.git_branch_upstream(&ptr, b.Reference.ptr)
240 runtime.KeepAlive(b.Reference)
241 if ret < 0 {
242 return nil, MakeGitError(ret)
243 }
244 return newReferenceFromC(ptr, b.repo), nil
245}
246
247func (repo *Repository) UpstreamName(canonicalBranchName string) (string, error) {
248 cName := C.CString(canonicalBranchName)

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
newReferenceFromCFunction · 0.85

Tested by

no test coverage detected