mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-03 17:37:53 +02:00
ssh only for git migrations
This commit is contained in:
@@ -39,13 +39,14 @@ type GitlabDownloaderFactory struct{}
|
||||
|
||||
// New returns a Downloader related to this factory according MigrateOptions
|
||||
func (f *GitlabDownloaderFactory) New(ctx context.Context, opts base.MigrateOptions) (base.Downloader, error) {
|
||||
info, err := parseServiceCloneURL(opts.CloneAddr)
|
||||
u, err := url.Parse(opts.CloneAddr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
baseURL := info.apiURL.String()
|
||||
repoNameSpace := strings.TrimSuffix(info.repoPath, ".git")
|
||||
baseURL := u.Scheme + "://" + u.Host
|
||||
repoNameSpace := strings.TrimPrefix(u.Path, "/")
|
||||
repoNameSpace = strings.TrimSuffix(repoNameSpace, ".git")
|
||||
|
||||
log.Trace("Create gitlab downloader. BaseURL: %s RepoName: %s", baseURL, repoNameSpace)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user