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

Method AddFile

config.go:74–88  ·  view source on GitHub ↗

AddFile adds a file-backed backend to the config object at the specified level.

(path string, level ConfigLevel, force bool)

Source from the content-addressed store, hash-verified

72
73// AddFile adds a file-backed backend to the config object at the specified level.
74func (c *Config) AddFile(path string, level ConfigLevel, force bool) error {
75 cpath := C.CString(path)
76 defer C.free(unsafe.Pointer(cpath))
77
78 runtime.LockOSThread()
79 defer runtime.UnlockOSThread()
80
81 ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), nil, cbool(force))
82 runtime.KeepAlive(c)
83 if ret < 0 {
84 return MakeGitError(ret)
85 }
86
87 return nil
88}
89
90func (c *Config) LookupInt32(name string) (int32, error) {
91 var out C.int32_t

Callers

nothing calls this directly

Calls 3

cboolFunction · 0.85
MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected