diff options
author | 6543 <6543@obermui.de> | 2021-09-09 08:02:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-09 07:02:22 +0100 |
commit | 3b13c5d41a35d6331b195b96a2ddb0e905cdcadb (patch) | |
tree | 61d40af0f640bc43497494c82fc26ae49361dcc9 /modules/task | |
parent | d27f06186306d3222c2601798fa221f2c474ae0c (diff) | |
download | gitea-3b13c5d41a35d6331b195b96a2ddb0e905cdcadb.tar.gz gitea-3b13c5d41a35d6331b195b96a2ddb0e905cdcadb.zip |
Fix bug of migrated repository not index (#16991) (#16996)
Fix #16986, #16152
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'modules/task')
-rw-r--r-- | modules/task/migrate.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/task/migrate.go b/modules/task/migrate.go index d7655112d3..707a519356 100644 --- a/modules/task/migrate.go +++ b/modules/task/migrate.go @@ -93,7 +93,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() @@ -107,7 +106,7 @@ func runMigrateTask(t *models.Task) (err error) { return } - repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts, func(format string, args ...interface{}) { + t.Repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts, func(format string, args ...interface{}) { message := models.TranslatableMessage{ Format: format, Args: args, @@ -118,7 +117,7 @@ func runMigrateTask(t *models.Task) (err error) { _ = t.UpdateCols("message") }) 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 } |