(name, value string)
| 218 | } |
| 219 | |
| 220 | func (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 | |
| 239 | func (c *Config) Free() { |
| 240 | runtime.SetFinalizer(c, nil) |