Skip to content

Commit dccba76

Browse files
hoitihStelios Malathouras
authored and
Stelios Malathouras
committed
Update object repo with the migrated repository (go-gitea#18684)
When migrating a repository (from GitHub) using the API (**POST** `repos/migrate`), the Code Indexer is not updated. Searching in the user interface will not return any results. When migrating the same repository using **+/New Migration** in the web interface, the search index is updated and searching works as expected. Caused by the fact that object `repo` is never updated with the migrated repo so `setting.Indexer.RepoIndexerEnabled && !repo.IsEmpty` in `modules/notification/indexer/indexer.go:NotifyMigrateRepository` always evaluates to `false`. Tested with gitea:1.16.1, MariaDB:10, Breve in `Run Mode: Dev`.
1 parent c7d6143 commit dccba76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/repo/migrate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func Migrate(ctx *context.APIContext) {
203203
}
204204
}()
205205

206-
if _, err = migrations.MigrateRepository(graceful.GetManager().HammerContext(), ctx.User, repoOwner.Name, opts, nil); err != nil {
206+
if repo, err = migrations.MigrateRepository(graceful.GetManager().HammerContext(), ctx.User, repoOwner.Name, opts, nil); err != nil {
207207
handleMigrateError(ctx, repoOwner, remoteAddr, err)
208208
return
209209
}

0 commit comments

Comments
 (0)