diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-01 22:16:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-01 22:16:57 +0000 |
commit | f5193cc76dd1a1c1bb55194a64ef90bae2278115 (patch) | |
tree | 74c5f184df4fb27bec0d6f809ce9816ec133d80f /bridge/core/bridge.go | |
parent | 11b4a1beb7e1ab8809515a5ce21e8708fba7f300 (diff) | |
parent | f9f82957a78ea0d3cacddbc6914ce98b94ddf7bd (diff) | |
download | git-bug-f5193cc76dd1a1c1bb55194a64ef90bae2278115.tar.gz |
Merge pull request #240 from MichaelMure/repo-config
repository config interface and implementation rework
Diffstat (limited to 'bridge/core/bridge.go')
-rw-r--r-- | bridge/core/bridge.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go index 6fd28b03..47a89389 100644 --- a/bridge/core/bridge.go +++ b/bridge/core/bridge.go @@ -134,7 +134,7 @@ func DefaultBridge(repo *cache.RepoCache) (*Bridge, error) { // ConfiguredBridges return the list of bridge that are configured for the given // repo func ConfiguredBridges(repo repository.RepoCommon) ([]string, error) { - configs, err := repo.ReadConfigs(bridgeConfigKeyPrefix + ".") + configs, err := repo.LocalConfig().ReadAll(bridgeConfigKeyPrefix + ".") if err != nil { return nil, errors.Wrap(err, "can't read configured bridges") } @@ -171,7 +171,7 @@ func ConfiguredBridges(repo repository.RepoCommon) ([]string, error) { func BridgeExist(repo repository.RepoCommon, name string) bool { keyPrefix := fmt.Sprintf("git-bug.bridge.%s.", name) - conf, err := repo.ReadConfigs(keyPrefix) + conf, err := repo.LocalConfig().ReadAll(keyPrefix) return err == nil && len(conf) > 0 } @@ -188,7 +188,7 @@ func RemoveBridge(repo repository.RepoCommon, name string) error { } keyPrefix := fmt.Sprintf("git-bug.bridge.%s", name) - return repo.RmConfigs(keyPrefix) + return repo.LocalConfig().RemoveAll(keyPrefix) } // Configure run the target specific configuration process @@ -211,7 +211,7 @@ func (b *Bridge) storeConfig(conf Configuration) error { for key, val := range conf { storeKey := fmt.Sprintf("git-bug.bridge.%s.%s", b.Name, key) - err := b.repo.StoreConfig(storeKey, val) + err := b.repo.LocalConfig().StoreString(storeKey, val) if err != nil { return errors.Wrap(err, "error while storing bridge configuration") } @@ -235,7 +235,7 @@ func (b *Bridge) ensureConfig() error { func loadConfig(repo repository.RepoCommon, name string) (Configuration, error) { keyPrefix := fmt.Sprintf("git-bug.bridge.%s.", name) - pairs, err := repo.ReadConfigs(keyPrefix) + pairs, err := repo.LocalConfig().ReadAll(keyPrefix) if err != nil { return nil, errors.Wrap(err, "error while reading bridge configuration") } |