aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/gitlab/config.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-02-15 13:54:30 +0100
committerGitHub <noreply@github.com>2020-02-15 13:54:30 +0100
commit02548c0e8f96a5c08efe46bd5f71f97fdd211de3 (patch)
treebb537e52035aa1d60d0405f7177b510e96aff1a6 /bridge/gitlab/config.go
parent362c0c7e2e1ce9a8e2918376a340c76f46569d64 (diff)
parent87b97ca4b2f39240c698596ac14a6d3532f6363d (diff)
downloadgit-bug-02548c0e8f96a5c08efe46bd5f71f97fdd211de3.tar.gz
Merge pull request #326 from MichaelMure/bridge-refactor
bridges: more refactor and cleanup
Diffstat (limited to 'bridge/gitlab/config.go')
-rw-r--r--bridge/gitlab/config.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/bridge/gitlab/config.go b/bridge/gitlab/config.go
index 94026635..b730a365 100644
--- a/bridge/gitlab/config.go
+++ b/bridge/gitlab/config.go
@@ -161,14 +161,18 @@ func promptTokenOptions(repo repository.RepoConfig, login, baseUrl string) (auth
return nil, err
}
- cred, err := input.PromptCredential(target, "token", creds)
- switch err {
- case nil:
+ cred, index, err := input.PromptCredential(target, "token", creds, []string{
+ "enter my token",
+ })
+ switch {
+ case err != nil:
+ return nil, err
+ case cred != nil:
return cred, nil
- case input.ErrDirectPrompt:
+ case index == 0:
return promptToken(baseUrl)
default:
- return nil, err
+ panic("missed case")
}
}