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

Method SetUpstream

branch.go:218–231  ·  view source on GitHub ↗
(upstreamName string)

Source from the content-addressed store, hash-verified

216}
217
218func (b *Branch) SetUpstream(upstreamName string) error {
219 cName := C.CString(upstreamName)
220 defer C.free(unsafe.Pointer(cName))
221
222 runtime.LockOSThread()
223 defer runtime.UnlockOSThread()
224
225 ret := C.git_branch_set_upstream(b.Reference.ptr, cName)
226 runtime.KeepAlive(b.Reference)
227 if ret < 0 {
228 return MakeGitError(ret)
229 }
230 return nil
231}
232
233func (b *Branch) Upstream() (*Reference, error) {
234

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected