(upstreamName string)
| 216 | } |
| 217 | |
| 218 | func (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 | |
| 233 | func (b *Branch) Upstream() (*Reference, error) { |
| 234 |
nothing calls this directly
no test coverage detected