diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-15 13:54:51 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-02-15 13:54:51 +0100 |
commit | cfa005889a7d398ee71eac4a6d4b23a691a7ef2a (patch) | |
tree | 15d115fa77e61194b39ff0e7745778de8924070f /bridge/core | |
parent | 432a816dde18a12c1479ed8151a11c29929476e0 (diff) | |
parent | 02548c0e8f96a5c08efe46bd5f71f97fdd211de3 (diff) | |
download | git-bug-cfa005889a7d398ee71eac4a6d4b23a691a7ef2a.tar.gz |
Merge remote-tracking branch 'origin/master' into cheshirekow-jira
Diffstat (limited to 'bridge/core')
-rw-r--r-- | bridge/core/auth/credential.go | 2 | ||||
-rw-r--r-- | bridge/core/bridge.go | 4 | ||||
-rw-r--r-- | bridge/core/config.go | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/bridge/core/auth/credential.go b/bridge/core/auth/credential.go index 86cf737e..2814e94c 100644 --- a/bridge/core/auth/credential.go +++ b/bridge/core/auth/credential.go @@ -123,7 +123,7 @@ func loadFromConfig(rawConfigs map[string]string, id entity.Id) (Credential, err case KindLoginPassword: cred, err = NewLoginPasswordFromConfig(configs) default: - return nil, fmt.Errorf("unknown credential type %s", configs[configKeyKind]) + return nil, fmt.Errorf("unknown credential type \"%s\"", configs[configKeyKind]) } if err != nil { diff --git a/bridge/core/bridge.go b/bridge/core/bridge.go index 62fd70f6..c72ff6b4 100644 --- a/bridge/core/bridge.go +++ b/bridge/core/bridge.go @@ -52,7 +52,7 @@ func Register(impl BridgeImpl) { if bridgeLoginMetaKey == nil { bridgeLoginMetaKey = make(map[string]string) } - bridgeImpl[impl.Target()] = reflect.TypeOf(impl) + bridgeImpl[impl.Target()] = reflect.TypeOf(impl).Elem() bridgeLoginMetaKey[impl.Target()] = impl.LoginMetaKey() } @@ -94,7 +94,7 @@ func NewBridge(repo *cache.RepoCache, target string, name string) (*Bridge, erro return nil, fmt.Errorf("unknown bridge target %v", target) } - impl := reflect.New(implType).Elem().Interface().(BridgeImpl) + impl := reflect.New(implType).Interface().(BridgeImpl) bridge := &Bridge{ Name: name, diff --git a/bridge/core/config.go b/bridge/core/config.go index afcda560..7f8d7e13 100644 --- a/bridge/core/config.go +++ b/bridge/core/config.go @@ -1,6 +1,8 @@ package core import ( + "fmt" + "github.com/MichaelMure/git-bug/cache" "github.com/MichaelMure/git-bug/identity" ) @@ -24,6 +26,7 @@ func FinishConfig(repo *cache.RepoCache, metaKey string, login string) error { return err } if err == nil { + fmt.Printf("Current identity %v tagged with login %v\n", user.Id().Human(), login) // found one user.SetMetadata(metaKey, login) return user.CommitAsNeeded() @@ -42,5 +45,7 @@ func FinishConfig(repo *cache.RepoCache, metaKey string, login string) error { return err } + fmt.Printf("Identity %v created, set as current\n", i.Id().Human()) + return nil } |