(level ConfigLevel)
| 40 | ) |
| 41 | |
| 42 | func SearchPath(level ConfigLevel) (string, error) { |
| 43 | var buf C.git_buf |
| 44 | defer C.git_buf_dispose(&buf) |
| 45 | |
| 46 | runtime.LockOSThread() |
| 47 | defer runtime.UnlockOSThread() |
| 48 | |
| 49 | err := C._go_git_opts_get_search_path(C.int(level), &buf) |
| 50 | if err < 0 { |
| 51 | return "", MakeGitError(err) |
| 52 | } |
| 53 | |
| 54 | return C.GoString(buf.ptr), nil |
| 55 | } |
| 56 | |
| 57 | func SetSearchPath(level ConfigLevel, path string) error { |
| 58 | cpath := C.CString(path) |
searching dependent graphs…