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

Function Discover

git.go:367–386  ·  view source on GitHub ↗
(start string, across_fs bool, ceiling_dirs []string)

Source from the content-addressed store, hash-verified

365}
366
367func Discover(start string, across_fs bool, ceiling_dirs []string) (string, error) {
368 ceildirs := C.CString(strings.Join(ceiling_dirs, string(C.GIT_PATH_LIST_SEPARATOR)))
369 defer C.free(unsafe.Pointer(ceildirs))
370
371 cstart := C.CString(start)
372 defer C.free(unsafe.Pointer(cstart))
373
374 var buf C.git_buf
375 defer C.git_buf_dispose(&buf)
376
377 runtime.LockOSThread()
378 defer runtime.UnlockOSThread()
379
380 ret := C.git_repository_discover(&buf, cstart, cbool(across_fs), ceildirs)
381 if ret < 0 {
382 return "", MakeGitError(ret)
383 }
384
385 return C.GoString(buf.ptr), nil
386}

Callers

nothing calls this directly

Calls 3

cboolFunction · 0.85
MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…