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

Function InitRepository

repository.go:109–123  ·  view source on GitHub ↗
(path string, isbare bool)

Source from the content-addressed store, hash-verified

107}
108
109func 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
125func NewRepositoryWrapOdb(odb *Odb) (repo *Repository, err error) {
126 runtime.LockOSThread()

Callers 2

createTestRepoFunction · 0.85
createBareTestRepoFunction · 0.85

Calls 4

ucboolFunction · 0.85
MakeGitErrorFunction · 0.85
newRepositoryFromCFunction · 0.85
freeMethod · 0.80

Tested by 2

createTestRepoFunction · 0.68
createBareTestRepoFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…