diff options
| author | Byoungchan Lee <[email protected]> | 2021-02-04 12:33:03 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-02-03 19:33:03 -0800 |
| commit | 2fd0495c43c4a54a02e2bbfca886687621f83f9f (patch) | |
| tree | 8a5df245daaa8f2fee8fc9c115ab276dab24eb6f /repository.go | |
| parent | 73d97b9bbe7c9a7747af20aad670baba33b5e390 (diff) | |
Implement git_repository_set_config (#735)
Closes #732
Diffstat (limited to 'repository.go')
| -rw-r--r-- | repository.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/repository.go b/repository.go index bba5700..a6eb7f1 100644 --- a/repository.go +++ b/repository.go @@ -165,6 +165,23 @@ func (v *Repository) Config() (*Config, error) { 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 { + runtime.LockOSThread() + defer runtime.UnlockOSThread() + + ret := C.git_repository_set_config(v.ptr, c.ptr) + runtime.KeepAlive(v) + runtime.KeepAlive(c) + if ret < 0 { + return MakeGitError(ret) + } + return nil +} + func (v *Repository) Index() (*Index, error) { var ptr *C.git_index |
