diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-08-31 19:58:29 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-08-31 19:58:29 +0200 |
| commit | 6d3a3499f1639a6272e334f9f74b1e0cf6b0bb49 (patch) | |
| tree | 04b27dfdf1faadcaff6ca40fa27d8edd690045d1 /branch.go | |
| parent | 157593f38da780c4f6cb6dc61275b9b36a3327bf (diff) | |
| parent | 4090c401c8bf3f062e898f75bde01e2ef27b3911 (diff) | |
Merge branch 'master-v23'
Diffstat (limited to 'branch.go')
| -rw-r--r-- | branch.go | 36 |
1 files changed, 4 insertions, 32 deletions
@@ -90,31 +90,17 @@ func (repo *Repository) NewBranchIterator(flags BranchType) (*BranchIterator, er return newBranchIteratorFromC(repo, ptr), nil } -func (repo *Repository) CreateBranch(branchName string, target *Commit, force bool, signature *Signature, msg string) (*Branch, error) { +func (repo *Repository) CreateBranch(branchName string, target *Commit, force bool) (*Branch, error) { var ptr *C.git_reference cBranchName := C.CString(branchName) defer C.free(unsafe.Pointer(cBranchName)) cForce := cbool(force) - cSignature, err := signature.toC() - if err != nil { - return nil, err - } - defer C.git_signature_free(cSignature) - - var cmsg *C.char - if msg == "" { - cmsg = nil - } else { - cmsg = C.CString(msg) - defer C.free(unsafe.Pointer(cmsg)) - } - runtime.LockOSThread() defer runtime.UnlockOSThread() - ret := C.git_branch_create(&ptr, repo.ptr, cBranchName, target.cast_ptr, cForce, cSignature, cmsg) + ret := C.git_branch_create(&ptr, repo.ptr, cBranchName, target.cast_ptr, cForce) if ret < 0 { return nil, MakeGitError(ret) } @@ -132,30 +118,16 @@ func (b *Branch) Delete() error { return nil } -func (b *Branch) Move(newBranchName string, force bool, signature *Signature, msg string) (*Branch, error) { +func (b *Branch) Move(newBranchName string, force bool) (*Branch, error) { var ptr *C.git_reference cNewBranchName := C.CString(newBranchName) defer C.free(unsafe.Pointer(cNewBranchName)) cForce := cbool(force) - cSignature, err := signature.toC() - if err != nil { - return nil, err - } - defer C.git_signature_free(cSignature) - - var cmsg *C.char - if msg == "" { - cmsg = nil - } else { - cmsg = C.CString(msg) - defer C.free(unsafe.Pointer(cmsg)) - } - runtime.LockOSThread() defer runtime.UnlockOSThread() - ret := C.git_branch_move(&ptr, b.Reference.ptr, cNewBranchName, cForce, cSignature, cmsg) + ret := C.git_branch_move(&ptr, b.Reference.ptr, cNewBranchName, cForce) if ret < 0 { return nil, MakeGitError(ret) } |
