Merge branch 'repo-ext'

This commit is contained in:
Carlos Martín Nieto 2014-05-23 16:02:36 +02:00
commit ec97cb4473
1 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,24 @@ func OpenRepository(path string) (*Repository, error) {
return repo, nil
}
func OpenRepositoryExtended(path string) (*Repository, error) {
repo := new(Repository)
cpath := C.CString(path)
defer C.free(unsafe.Pointer(cpath))
runtime.LockOSThread()
defer runtime.UnlockOSThread()
ret := C.git_repository_open_ext(&repo.ptr, cpath, 0, nil)
if ret < 0 {
return nil, MakeGitError(ret)
}
runtime.SetFinalizer(repo, (*Repository).Free)
return repo, nil
}
func InitRepository(path string, isbare bool) (*Repository, error) {
repo := new(Repository)