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

Function OpenOndisk

config.go:348–362  ·  view source on GitHub ↗

OpenOndisk creates a new config instance containing a single on-disk file

(path string)

Source from the content-addressed store, hash-verified

346
347// OpenOndisk creates a new config instance containing a single on-disk file
348func 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
364type ConfigIterator struct {
365 doNotCompare

Callers 1

setupConfigFunction · 0.85

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 1

setupConfigFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…