mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-05 23:34:19 -04:00
parent
aeec78543b
commit
30718ce4ac
@ -9,6 +9,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -79,11 +80,21 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var remoteAddr = repo.CloneURL
|
||||||
|
if len(opts.AuthUsername) > 0 {
|
||||||
|
u, err := url.Parse(repo.CloneURL)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
u.User = url.UserPassword(opts.AuthUsername, opts.AuthPassword)
|
||||||
|
remoteAddr = u.String()
|
||||||
|
}
|
||||||
|
|
||||||
r, err := models.MigrateRepository(g.doer, owner, models.MigrateRepoOptions{
|
r, err := models.MigrateRepository(g.doer, owner, models.MigrateRepoOptions{
|
||||||
Name: g.repoName,
|
Name: g.repoName,
|
||||||
Description: repo.Description,
|
Description: repo.Description,
|
||||||
IsMirror: repo.IsMirror,
|
IsMirror: repo.IsMirror,
|
||||||
RemoteAddr: repo.CloneURL,
|
RemoteAddr: remoteAddr,
|
||||||
IsPrivate: repo.IsPrivate,
|
IsPrivate: repo.IsPrivate,
|
||||||
Wiki: opts.Wiki,
|
Wiki: opts.Wiki,
|
||||||
SyncReleasesWithTags: !opts.Releases, // if didn't get releases, then sync them from tags
|
SyncReleasesWithTags: !opts.Releases, // if didn't get releases, then sync them from tags
|
||||||
|
Loading…
Reference in New Issue
Block a user