(path string)
| 59 | } |
| 60 | |
| 61 | func OpenRepository(path string) (*Repository, error) { |
| 62 | cpath := C.CString(path) |
| 63 | defer C.free(unsafe.Pointer(cpath)) |
| 64 | |
| 65 | runtime.LockOSThread() |
| 66 | defer runtime.UnlockOSThread() |
| 67 | |
| 68 | var ptr *C.git_repository |
| 69 | ret := C.git_repository_open(&ptr, cpath) |
| 70 | if ret < 0 { |
| 71 | return nil, MakeGitError(ret) |
| 72 | } |
| 73 | |
| 74 | return newRepositoryFromC(ptr), nil |
| 75 | } |
| 76 | |
| 77 | type RepositoryOpenFlag int |
| 78 |
searching dependent graphs…