NewConfig creates a new empty configuration object
()
| 58 | |
| 59 | // NewConfig creates a new empty configuration object |
| 60 | func NewConfig() (*Config, error) { |
| 61 | config := new(Config) |
| 62 | |
| 63 | runtime.LockOSThread() |
| 64 | defer runtime.UnlockOSThread() |
| 65 | |
| 66 | if ret := C.git_config_new(&config.ptr); ret < 0 { |
| 67 | return nil, MakeGitError(ret) |
| 68 | } |
| 69 | |
| 70 | return config, nil |
| 71 | } |
| 72 | |
| 73 | // AddFile adds a file-backed backend to the config object at the specified level. |
| 74 | func (c *Config) AddFile(path string, level ConfigLevel, force bool) error { |
nothing calls this directly
no test coverage detected
searching dependent graphs…