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

Method Name

branch.go:183–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

181}
182
183func (b *Branch) Name() (string, error) {
184 var cName *C.char
185 defer C.free(unsafe.Pointer(cName))
186
187 runtime.LockOSThread()
188 defer runtime.UnlockOSThread()
189
190 ret := C.git_branch_name(&cName, b.Reference.ptr)
191 runtime.KeepAlive(b.Reference)
192 if ret < 0 {
193 return "", MakeGitError(ret)
194 }
195
196 return C.GoString(cName), nil
197}
198
199func (repo *Repository) RemoteName(canonicalBranchName string) (string, error) {
200 cName := C.CString(canonicalBranchName)

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected