summaryrefslogtreecommitdiff
path: root/branch.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2015-06-28 01:32:13 +0200
committerCarlos Martín Nieto <[email protected]>2015-06-28 01:32:13 +0200
commite50203a2531209d32fab9d9b5fea3ff55c873c86 (patch)
tree782cd6f6816aec27707f2b84df4471e9a6983440 /branch.go
parent70c95a7655eddffda4cd8fddd87536c5580136fe (diff)
parent2488de286c0f73b31e95820835767adc3d2ee101 (diff)
Merge remote-tracking branch 'upstream/master' into next
Conflicts: branch.go
Diffstat (limited to 'branch.go')
-rw-r--r--branch.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/branch.go b/branch.go
index 0daa99d..d0a0835 100644
--- a/branch.go
+++ b/branch.go
@@ -92,18 +92,18 @@ func (repo *Repository) NewBranchIterator(flags BranchType) (*BranchIterator, er
func (repo *Repository) CreateBranch(branchName string, target *Commit, force bool) (*Branch, error) {
- ref := new(Reference)
+ var ptr *C.git_reference
cBranchName := C.CString(branchName)
cForce := cbool(force)
runtime.LockOSThread()
defer runtime.UnlockOSThread()
- ret := C.git_branch_create(&ref.ptr, repo.ptr, cBranchName, target.cast_ptr, cForce)
+ ret := C.git_branch_create(&ptr, repo.ptr, cBranchName, target.cast_ptr, cForce)
if ret < 0 {
return nil, MakeGitError(ret)
}
- return ref.Branch(), nil
+ return newReferenceFromC(ptr, repo).Branch(), nil
}
func (b *Branch) Delete() error {