aboutsummaryrefslogtreecommitdiffstats
path: root/modules/task/migrate.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-09-09 01:43:19 +0800
committerGitHub <noreply@github.com>2021-09-08 18:43:19 +0100
commitefdbba44538939d6355cceef59fc18c01bb07630 (patch)
tree55741b7eb35cd5cc3d0776cdb8c02cf9423d29ca /modules/task/migrate.go
parent1b922374db227815a765b44df7692ce61934f699 (diff)
downloadgitea-efdbba44538939d6355cceef59fc18c01bb07630.tar.gz
gitea-efdbba44538939d6355cceef59fc18c01bb07630.zip
Fix bug of migrated repository not index (#16991)
Fix #16986, #16152
Diffstat (limited to 'modules/task/migrate.go')
-rw-r--r--modules/task/migrate.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules/task/migrate.go b/modules/task/migrate.go
index 481422403b..52f4bb91cf 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,
@@ -117,7 +116,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
}