Skip to content

Commit

Permalink
Fix bug of migrated repository not index (go-gitea#16991)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and 6543 committed Sep 8, 2021
1 parent d27f061 commit 5c1c2d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/task/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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,
Expand All @@ -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
}

Expand Down

0 comments on commit 5c1c2d5

Please sign in to comment.