(path string, isbare bool)
| 107 | } |
| 108 | |
| 109 | func InitRepository(path string, isbare bool) (*Repository, error) { |
| 110 | cpath := C.CString(path) |
| 111 | defer C.free(unsafe.Pointer(cpath)) |
| 112 | |
| 113 | runtime.LockOSThread() |
| 114 | defer runtime.UnlockOSThread() |
| 115 | |
| 116 | var ptr *C.git_repository |
| 117 | ret := C.git_repository_init(&ptr, cpath, ucbool(isbare)) |
| 118 | if ret < 0 { |
| 119 | return nil, MakeGitError(ret) |
| 120 | } |
| 121 | |
| 122 | return newRepositoryFromC(ptr), nil |
| 123 | } |
| 124 | |
| 125 | func NewRepositoryWrapOdb(odb *Odb) (repo *Repository, err error) { |
| 126 | runtime.LockOSThread() |
searching dependent graphs…