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

Function OpenRepository

repository.go:61–75  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

59}
60
61func 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
77type RepositoryOpenFlag int
78

Callers 4

TestReachableFromAnyFunction · 0.85
TestTreeWalkFunction · 0.85
TestTreeWalkSkipFunction · 0.85
TestTreeWalkStopFunction · 0.85

Calls 3

MakeGitErrorFunction · 0.85
newRepositoryFromCFunction · 0.85
freeMethod · 0.80

Tested by 4

TestReachableFromAnyFunction · 0.68
TestTreeWalkFunction · 0.68
TestTreeWalkSkipFunction · 0.68
TestTreeWalkStopFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…