diff options
author | amine <hilalyamine@gmail.com> | 2019-11-01 22:40:21 +0100 |
---|---|---|
committer | amine <hilalyamine@gmail.com> | 2019-11-01 22:44:11 +0100 |
commit | 60c6bd360f164b8f955b21cd1d0bc0cca6e5cb51 (patch) | |
tree | f82d8638276ddffe244063c5deffb8b7c21cbcd6 /bridge/core | |
parent | 618f896f667b272c1272b1289c8ff3f3310c3168 (diff) | |
download | git-bug-60c6bd360f164b8f955b21cd1d0bc0cca6e5cb51.tar.gz |
bridge: use new repository configuration interface
commands/webui: use new repository configuration interface
Diffstat (limited to 'bridge/core')
-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") } |