diff options
-rw-r--r-- | repository.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/repository.go b/repository.go index 60baf85..47318d1 100644 --- a/repository.go +++ b/repository.go @@ -435,11 +435,20 @@ func cleanUpDir(path string, all bool) error { return err } -// Config return the repository config +// Config return the repository config. In a filesystem backed repository this +// means read the `.git/config`. func (r *Repository) Config() (*config.Config, error) { return r.Storer.Config() } +// SetConfig marshall and writes the repository config. In a filesystem backed +// repository this means write the `.git/config`. This function should be called +// with the result of `Repository.Config` and never with the output of +// `Repository.ConfigScoped`. +func (r *Repository) SetConfig(cfg *config.Config) error { + return r.Storer.SetConfig(cfg) +} + // ConfigScoped returns the repository config, merged with requested scope and // lower. For example if, config.GlobalScope is given the local and global config // are returned merged in one config value. |