mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
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 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]>
This commit is contained in:
co-authored by
GitHub
Gernot Eger
Lunny Xiao
parent
058ee52333
commit
d737eaa63a
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user