loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'fix(code search): empty mode dropdown when keyword is empty' (#6441) from snematoda/no-q-filter-fix into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6441
Reviewed-by: 0ko <0ko@noreply.codeberg.org>

0ko 13ea8296 d5bd212d

+7 -3
+6 -3
routers/web/repo/search.go
··· 67 67 ctx.Data["CodeSearchPath"] = path 68 68 ctx.Data["CodeSearchMode"] = mode.String() 69 69 ctx.Data["PageIsViewCode"] = true 70 + ctx.Data["CodeIndexerDisabled"] = !setting.Indexer.RepoIndexerEnabled 71 + if setting.Indexer.RepoIndexerEnabled { 72 + ctx.Data["CodeSearchOptions"] = code_indexer.CodeSearchOptions 73 + } else { 74 + ctx.Data["CodeSearchOptions"] = git.GrepSearchOptions 75 + } 70 76 71 77 if keyword == "" { 72 78 ctx.HTML(http.StatusOK, tplSearch) ··· 103 109 } else { 104 110 ctx.Data["CodeIndexerUnavailable"] = !code_indexer.IsAvailable(ctx) 105 111 } 106 - ctx.Data["CodeSearchOptions"] = code_indexer.CodeSearchOptions 107 112 } else { 108 113 grepOpt := git.GrepOptions{ 109 114 ContextLineNumber: 1, ··· 139 144 strings.Join(r.LineCodes, "\n")), 140 145 }) 141 146 } 142 - ctx.Data["CodeSearchOptions"] = git.GrepSearchOptions 143 147 } 144 148 145 - ctx.Data["CodeIndexerDisabled"] = !setting.Indexer.RepoIndexerEnabled 146 149 ctx.Data["Repo"] = ctx.Repo.Repository 147 150 ctx.Data["SourcePath"] = ctx.Repo.Repository.Link() 148 151 ctx.Data["SearchResults"] = searchResults
+1
tests/integration/repo_search_test.go
··· 78 78 code_indexer.UpdateRepoIndexer(repo) 79 79 } 80 80 81 + testSearch(t, "/user2/glob/search?q=", []string{}, indexer) 81 82 testSearch(t, "/user2/glob/search?q=loren&page=1", []string{"a.txt"}, indexer) 82 83 testSearch(t, "/user2/glob/search?q=loren&page=1&mode=exact", []string{"a.txt"}, indexer) 83 84