Skip to content

Commit 3b13c5d

Browse files
6543lunny
andauthored
Fix bug of migrated repository not index (#16991) (#16996)
Fix #16986, #16152 Co-authored-by: Lunny Xiao <[email protected]>
1 parent d27f061 commit 3b13c5d

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,
@@ -118,7 +117,7 @@ func runMigrateTask(t *models.Task) (err error) {
118117
_ = t.UpdateCols("message")
119118
})
120119
if err == nil {
121-
log.Trace("Repository migrated [%d]: %s/%s", repo.ID, t.Owner.Name, repo.Name)
120+
log.Trace("Repository migrated [%d]: %s/%s", t.Repo.ID, t.Owner.Name, t.Repo.Name)
122121
return
123122
}
124123

0 commit comments

Comments
 (0)