diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-23 19:20:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-23 19:20:45 +0100 |
commit | 8ef6438fb476e9d510a39ead321cbeee6288e2d2 (patch) | |
tree | 2bcd2a5420bbdbed13b3de82992c30b7d17893e2 /bridge/gitlab/config.go | |
parent | 0e68c10ffc3f9e72e32b8cdfcd917b3fe1ab240c (diff) | |
parent | 0cebe1e57e7e4b03aef77cd11bd4fc683c32afc6 (diff) | |
download | git-bug-8ef6438fb476e9d510a39ead321cbeee6288e2d2.tar.gz |
Merge pull request #341 from MichaelMure/bridges-default-login
bridge: record the login used during the configure and use it as default credential
Diffstat (limited to 'bridge/gitlab/config.go')
-rw-r--r-- | bridge/gitlab/config.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bridge/gitlab/config.go b/bridge/gitlab/config.go index d5dc418c..8d2490b8 100644 --- a/bridge/gitlab/config.go +++ b/bridge/gitlab/config.go @@ -117,6 +117,7 @@ func (g *Gitlab) Configure(repo *cache.RepoCache, params core.BridgeParams) (cor conf[core.ConfigKeyTarget] = target conf[confKeyProjectID] = strconv.Itoa(id) conf[confKeyGitlabBaseUrl] = baseUrl + conf[confKeyDefaultLogin] = login err = g.ValidateConfig(conf) if err != nil { @@ -146,6 +147,9 @@ func (g *Gitlab) ValidateConfig(conf core.Configuration) error { if _, ok := conf[confKeyProjectID]; !ok { return fmt.Errorf("missing %s key", confKeyProjectID) } + if _, ok := conf[confKeyDefaultLogin]; !ok { + return fmt.Errorf("missing %s key", confKeyDefaultLogin) + } return nil } @@ -246,12 +250,12 @@ func getValidGitlabRemoteURLs(repo repository.RepoCommon, baseUrl string) ([]str urls := make([]string, 0, len(remotes)) for _, u := range remotes { - path, err := getProjectPath(baseUrl, u) + p, err := getProjectPath(baseUrl, u) if err != nil { continue } - urls = append(urls, fmt.Sprintf("%s/%s", baseUrl, path)) + urls = append(urls, fmt.Sprintf("%s/%s", baseUrl, p)) } return urls, nil |