Update repository.go to add a comment for the public API and fix Runtime issue.
This commit is contained in:
parent
a23d33dee4
commit
ade1fdde29
|
@ -165,12 +165,17 @@ func (v *Repository) Config() (*Config, error) {
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetConfig sets the configuration file for this repository.
|
||||||
|
//
|
||||||
|
// This configuration file will be used for all configuration queries involving
|
||||||
|
// this repository.
|
||||||
func (v *Repository) SetConfig(c *Config) error {
|
func (v *Repository) SetConfig(c *Config) error {
|
||||||
runtime.LockOSThread()
|
runtime.LockOSThread()
|
||||||
defer runtime.UnlockOSThread()
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
ret := C.git_repository_set_config(v.ptr, c.ptr)
|
ret := C.git_repository_set_config(v.ptr, c.ptr)
|
||||||
runtime.KeepAlive(v)
|
runtime.KeepAlive(v)
|
||||||
|
runtime.KeepAlive(c)
|
||||||
if ret < 0 {
|
if ret < 0 {
|
||||||
return MakeGitError(ret)
|
return MakeGitError(ret)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue