From feab9412dffe5772048aad29893c4cb01d566387 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 21 Nov 2018 18:56:12 +0100 Subject: WIP identity in git --- bridge/core/bridge.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bridge/core/bridge.go') diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go index 91ed5bfb..96646edb 100644 --- a/bridge/core/bridge.go +++ b/bridge/core/bridge.go @@ -15,6 +15,8 @@ import ( var ErrImportNorSupported = errors.New("import is not supported") var ErrExportNorSupported = errors.New("export is not supported") +const bridgeConfigKeyPrefix = "git-bug.bridge" + var bridgeImpl map[string]reflect.Type // Bridge is a wrapper around a BridgeImpl that will bind low-level @@ -114,12 +116,12 @@ func splitFullName(fullName string) (string, string, 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("git-bug.bridge.") + configs, err := repo.ReadConfigs(bridgeConfigKeyPrefix + ".") if err != nil { return nil, errors.Wrap(err, "can't read configured bridges") } - re, err := regexp.Compile(`git-bug.bridge.([^.]+\.[^.]+)`) + re, err := regexp.Compile(bridgeConfigKeyPrefix + `.([^.]+\.[^.]+)`) if err != nil { panic(err) } -- cgit