MCPcopy Create free account
hub / github.com/libgit2/git2go / OpenRepositoryExtended

Function OpenRepositoryExtended

repository.go:87–107  ·  view source on GitHub ↗
(path string, flags RepositoryOpenFlag, ceiling string)

Source from the content-addressed store, hash-verified

85)
86
87func OpenRepositoryExtended(path string, flags RepositoryOpenFlag, ceiling string) (*Repository, error) {
88 cpath := C.CString(path)
89 defer C.free(unsafe.Pointer(cpath))
90
91 var cceiling *C.char = nil
92 if len(ceiling) > 0 {
93 cceiling = C.CString(ceiling)
94 defer C.free(unsafe.Pointer(cceiling))
95 }
96
97 runtime.LockOSThread()
98 defer runtime.UnlockOSThread()
99
100 var ptr *C.git_repository
101 ret := C.git_repository_open_ext(&ptr, cpath, C.uint(flags), cceiling)
102 if ret < 0 {
103 return nil, MakeGitError(ret)
104 }
105
106 return newRepositoryFromC(ptr), nil
107}
108
109func InitRepository(path string, isbare bool) (*Repository, error) {
110 cpath := C.CString(path)

Callers

nothing calls this directly

Calls 3

MakeGitErrorFunction · 0.85
newRepositoryFromCFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…