Skip to content

Commit f8503b5

Browse files
6543lunny
andauthored
Fix bug of migrated repository not index (#16991) (#16995)
Fix #16986, #16152 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
1 parent 0e53baf commit f8503b5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: modules/task/migrate.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ func runMigrateTask(t *models.Task) (err error) {
9292
}
9393

9494
opts.MigrateToRepoID = t.RepoID
95-
var repo *models.Repository
9695

9796
ctx, cancel := context.WithCancel(graceful.GetManager().ShutdownContext())
9897
defer cancel()
@@ -106,9 +105,9 @@ func runMigrateTask(t *models.Task) (err error) {
106105
return
107106
}
108107

109-
repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts)
108+
t.Repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts)
110109
if err == nil {
111-
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, t.Owner.Name, repo.Name)
110+
log.Trace("Repository migrated [%d]: %s/%s", t.Repo.ID, t.Owner.Name, t.Repo.Name)
112111
return
113112
}
114113

0 commit comments

Comments
 (0)