From f8503b5fbf2ad9b04db6a8bfa5d4922e55c28430 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 8 Sep 2021 23:32:54 +0200 Subject: [PATCH] Fix bug of migrated repository not index (#16991) (#16995) Fix #16986, #16152 Co-authored-by: Lunny Xiao --- modules/task/migrate.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/task/migrate.go b/modules/task/migrate.go index 57424abac3..0485036bba 100644 --- a/modules/task/migrate.go +++ b/modules/task/migrate.go @@ -92,7 +92,6 @@ func runMigrateTask(t *models.Task) (err error) { } opts.MigrateToRepoID = t.RepoID - var repo *models.Repository ctx, cancel := context.WithCancel(graceful.GetManager().ShutdownContext()) defer cancel() @@ -106,9 +105,9 @@ func runMigrateTask(t *models.Task) (err error) { return } - repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts) + t.Repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts) if err == nil { - log.Trace("Repository migrated [%d]: %s/%s", repo.ID, t.Owner.Name, repo.Name) + log.Trace("Repository migrated [%d]: %s/%s", t.Repo.ID, t.Owner.Name, t.Repo.Name) return }