ConfigFindProgramdata locate the path to the configuration file in ProgramData. Look for the file in %PROGRAMDATA%\Git\config used by portable git.
()
| 439 | // |
| 440 | // Look for the file in %PROGRAMDATA%\Git\config used by portable git. |
| 441 | func ConfigFindProgramdata() (string, error) { |
| 442 | var buf C.git_buf |
| 443 | defer C.git_buf_dispose(&buf) |
| 444 | |
| 445 | runtime.LockOSThread() |
| 446 | defer runtime.UnlockOSThread() |
| 447 | |
| 448 | ret := C.git_config_find_programdata(&buf) |
| 449 | if ret < 0 { |
| 450 | return "", MakeGitError(ret) |
| 451 | } |
| 452 | |
| 453 | return C.GoString(buf.ptr), nil |
| 454 | } |
| 455 | |
| 456 | // OpenDefault opens the default config according to git rules |
| 457 | func OpenDefault() (*Config, error) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…