mirror of
https://github.com/go-gitea/gitea
synced 2025-07-07 11:07:20 +00:00
Backport Migration Option AuthToken (#13101)
fix #13085 Backport #12862 Backport Parts of #12672
This commit is contained in:
@ -36,6 +36,12 @@ func MigrateRepository(ctx context.Context, doer *models.User, ownerName string,
|
||||
theFactory base.DownloaderFactory
|
||||
)
|
||||
|
||||
// determine if user is token
|
||||
if len(opts.AuthUsername) != 0 && len(opts.AuthPassword) == 0 {
|
||||
opts.AuthToken = opts.AuthUsername
|
||||
opts.AuthUsername = ""
|
||||
}
|
||||
|
||||
for _, factory := range factories {
|
||||
if match, err := factory.Match(opts); err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user