]> source.dussan.org Git - gitea.git/commitdiff
Set the base url when migrating from Gitlab using access token or username without...
authorzeripath <art27@cantab.net>
Thu, 2 Jul 2020 12:26:47 +0000 (13:26 +0100)
committerGitHub <noreply@github.com>
Thu, 2 Jul 2020 12:26:47 +0000 (20:26 +0800)
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>
modules/migrations/gitlab.go

index 8e1c7d0a833d4709c2e685cc919972430ecf9cc7..4f218c95f1f99550b11bf93ee9446de1e404773a 100644 (file)
@@ -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))
                }