From d737eaa63a22344595347dfcbc23d8a7a13a88ee Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 2 Jul 2020 13:26:47 +0100 Subject: [PATCH] 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 Co-authored-by: Lunny Xiao --- modules/migrations/gitlab.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/migrations/gitlab.go b/modules/migrations/gitlab.go index 8e1c7d0a833d..4f218c95f1f9 100644 --- a/modules/migrations/gitlab.go +++ b/modules/migrations/gitlab.go @@ -90,7 +90,7 @@ func NewGitlabDownloader(baseURL, repoPath, username, password string) *GitlabDo var err error if username != "" { if password == "" { - gitlabClient, err = gitlab.NewClient(username) + gitlabClient, err = gitlab.NewClient(username, gitlab.WithBaseURL(baseURL)) } else { gitlabClient, err = gitlab.NewBasicAuthClient(username, password, gitlab.WithBaseURL(baseURL)) }