Making things work with libgit2 at 2dc49ea #54

Closed
meatballhat wants to merge 8 commits from working-with-libgit2-at-2dc49ea into master
1 changed files with 4 additions and 3 deletions
Showing only changes of commit 295ec8894c - Show all commits

View File

@ -6,8 +6,8 @@ package git
*/ */
import "C" import "C"
import ( import (
"unsafe"
"runtime" "runtime"
"unsafe"
) )
// Repository // Repository
@ -226,7 +226,7 @@ func (repo *Repository) Path() string {
return C.GoString(C.git_repository_path(repo.ptr)) return C.GoString(C.git_repository_path(repo.ptr))
} }
func (repo *Repository) IsBare() (bool) { func (repo *Repository) IsBare() bool {
return C.git_repository_is_bare(repo.ptr) != 0 return C.git_repository_is_bare(repo.ptr) != 0
} }
@ -249,6 +249,7 @@ func (v *Repository) TreeBuilder() (*TreeBuilder, error) {
if ret := C.git_treebuilder_create(&bld.ptr, nil); ret < 0 { if ret := C.git_treebuilder_create(&bld.ptr, nil); ret < 0 {
return nil, LastError() return nil, LastError()
} }
runtime.SetFinalizer(bld, (*TreeBuilder).Free)
bld.repo = v bld.repo = v
return bld, nil return bld, nil