()
| 181 | } |
| 182 | |
| 183 | func (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 | |
| 199 | func (repo *Repository) RemoteName(canonicalBranchName string) (string, error) { |
| 200 | cName := C.CString(canonicalBranchName) |
nothing calls this directly
no test coverage detected