[v7.0/forgejo] [BUG] Fix code search in explore reporting as git grep even with indexer enabled (#3204)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/3173

regression caused in porting #2813 🫣

see https://codeberg.org/forgejo/forgejo/pulls/2688#issuecomment-1692750

Co-authored-by: Shiny Nematoda <snematoda.751k2@aleeas.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3204
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2024-04-14 14:21:31 +00:00 committed by Earl Warren
parent ef0ab3cdaf
commit 1b8fd7b17b
6 changed files with 51 additions and 26 deletions

View file

@ -86,7 +86,7 @@ func Search(ctx *context.Context) {
}
}
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["CodeIndexerDisabled"] = !setting.Indexer.RepoIndexerEnabled
ctx.Data["Repo"] = ctx.Repo.Repository
ctx.Data["SourcePath"] = ctx.Repo.Repository.Link()
ctx.Data["SearchResults"] = searchResults