(canonicalBranchName string)
| 245 | } |
| 246 | |
| 247 | func (repo *Repository) UpstreamName(canonicalBranchName string) (string, error) { |
| 248 | cName := C.CString(canonicalBranchName) |
| 249 | defer C.free(unsafe.Pointer(cName)) |
| 250 | |
| 251 | nameBuf := C.git_buf{} |
| 252 | |
| 253 | runtime.LockOSThread() |
| 254 | defer runtime.UnlockOSThread() |
| 255 | |
| 256 | ret := C.git_branch_upstream_name(&nameBuf, repo.ptr, cName) |
| 257 | runtime.KeepAlive(repo) |
| 258 | if ret < 0 { |
| 259 | return "", MakeGitError(ret) |
| 260 | } |
| 261 | defer C.git_buf_dispose(&nameBuf) |
| 262 | |
| 263 | return C.GoString(nameBuf.ptr), nil |
| 264 | } |
nothing calls this directly
no test coverage detected