OpenOndisk creates a new config instance containing a single on-disk file
(path string)
| 346 | |
| 347 | // OpenOndisk creates a new config instance containing a single on-disk file |
| 348 | func OpenOndisk(path string) (*Config, error) { |
| 349 | cpath := C.CString(path) |
| 350 | defer C.free(unsafe.Pointer(cpath)) |
| 351 | |
| 352 | config := new(Config) |
| 353 | |
| 354 | runtime.LockOSThread() |
| 355 | defer runtime.UnlockOSThread() |
| 356 | |
| 357 | if ret := C.git_config_open_ondisk(&config.ptr, cpath); ret < 0 { |
| 358 | return nil, MakeGitError(ret) |
| 359 | } |
| 360 | |
| 361 | return config, nil |
| 362 | } |
| 363 | |
| 364 | type ConfigIterator struct { |
| 365 | doNotCompare |
searching dependent graphs…