Backport Migration Option AuthToken (#13101)

fix #13085

Backport #12862
Backport Parts of #12672
This commit is contained in:
6543 2020-10-12 08:14:02 +02:00 committed by GitHub
parent d4af0df967
commit f9942add50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 37 additions and 33 deletions

View file

@ -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