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

Method SetString

config.go:220–237  ·  view source on GitHub ↗
(name, value string)

Source from the content-addressed store, hash-verified

218}
219
220func (c *Config) SetString(name, value string) (err error) {
221 cname := C.CString(name)
222 defer C.free(unsafe.Pointer(cname))
223
224 cvalue := C.CString(value)
225 defer C.free(unsafe.Pointer(cvalue))
226
227 runtime.LockOSThread()
228 defer runtime.UnlockOSThread()
229
230 ret := C.git_config_set_string(c.ptr, cname, cvalue)
231 runtime.KeepAlive(c)
232 if ret < 0 {
233 return MakeGitError(ret)
234 }
235
236 return nil
237}
238
239func (c *Config) Free() {
240 runtime.SetFinalizer(c, nil)

Callers 2

setupConfigFunction · 0.80
TestRemoteConnectOptionFunction · 0.80

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by 2

setupConfigFunction · 0.64
TestRemoteConnectOptionFunction · 0.64