Set the base url when migrating from Gitlab using access token or username without password (#11852) (#12104)

Backport #11852

When migrating from gitlab, set the baseUrl in NewGitlabDownloader when using an access token or username without password

Fix #11851

Co-authored-by: Gernot Eger <gernot.eger@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
zeripath 2020-07-02 13:26:47 +01:00 committed by GitHub
parent 058ee52333
commit d737eaa63a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -90,7 +90,7 @@ func NewGitlabDownloader(baseURL, repoPath, username, password string) *GitlabDo
var err error var err error
if username != "" { if username != "" {
if password == "" { if password == "" {
gitlabClient, err = gitlab.NewClient(username) gitlabClient, err = gitlab.NewClient(username, gitlab.WithBaseURL(baseURL))
} else { } else {
gitlabClient, err = gitlab.NewBasicAuthClient(username, password, gitlab.WithBaseURL(baseURL)) gitlabClient, err = gitlab.NewBasicAuthClient(username, password, gitlab.WithBaseURL(baseURL))
} }