(newBranchName string, force bool)
| 130 | } |
| 131 | |
| 132 | func (b *Branch) Move(newBranchName string, force bool) (*Branch, error) { |
| 133 | var ptr *C.git_reference |
| 134 | cNewBranchName := C.CString(newBranchName) |
| 135 | defer C.free(unsafe.Pointer(cNewBranchName)) |
| 136 | cForce := cbool(force) |
| 137 | |
| 138 | runtime.LockOSThread() |
| 139 | defer runtime.UnlockOSThread() |
| 140 | |
| 141 | ret := C.git_branch_move(&ptr, b.Reference.ptr, cNewBranchName, cForce) |
| 142 | runtime.KeepAlive(b.Reference) |
| 143 | if ret < 0 { |
| 144 | return nil, MakeGitError(ret) |
| 145 | } |
| 146 | return newReferenceFromC(ptr, b.repo).Branch(), nil |
| 147 | } |
| 148 | |
| 149 | func (b *Branch) IsHead() (bool, error) { |
| 150 |
nothing calls this directly
no test coverage detected