Merge branch 'repo-ext'
This commit is contained in:
commit
ec97cb4473
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue