Skip to content

Commit efdbba4

Browse files
authored
Fix bug of migrated repository not index (#16991)
Fix #16986, #16152
1 parent 1b92237 commit efdbba4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/task/migrate.go

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

9595
opts.MigrateToRepoID = t.RepoID
96-
var repo *models.Repository
9796

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

110-
repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts, func(format string, args ...interface{}) {
109+
t.Repo, err = migrations.MigrateRepository(ctx, t.Doer, t.Owner.Name, *opts, func(format string, args ...interface{}) {
111110
message := models.TranslatableMessage{
112111
Format: format,
113112
Args: args,
@@ -117,7 +116,7 @@ func runMigrateTask(t *models.Task) (err error) {
117116
_ = t.UpdateCols("message")
118117
})
119118
if err == nil {
120-
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, t.Owner.Name, repo.Name)
119+
log.Trace("Repository migrated [%d]: %s/%s", t.Repo.ID, t.Owner.Name, t.Repo.Name)
121120
return
122121
}
123122

0 commit comments

Comments
 (0)