(canonicalBranchName string)
| 197 | } |
| 198 | |
| 199 | func (repo *Repository) RemoteName(canonicalBranchName string) (string, error) { |
| 200 | cName := C.CString(canonicalBranchName) |
| 201 | defer C.free(unsafe.Pointer(cName)) |
| 202 | |
| 203 | nameBuf := C.git_buf{} |
| 204 | |
| 205 | runtime.LockOSThread() |
| 206 | defer runtime.UnlockOSThread() |
| 207 | |
| 208 | ret := C.git_branch_remote_name(&nameBuf, repo.ptr, cName) |
| 209 | runtime.KeepAlive(repo) |
| 210 | if ret < 0 { |
| 211 | return "", MakeGitError(ret) |
| 212 | } |
| 213 | defer C.git_buf_dispose(&nameBuf) |
| 214 | |
| 215 | return C.GoString(nameBuf.ptr), nil |
| 216 | } |
| 217 | |
| 218 | func (b *Branch) SetUpstream(upstreamName string) error { |
| 219 | cName := C.CString(upstreamName) |
nothing calls this directly
no test coverage detected