Skip to content

Commit 6edee2e

Browse files
GiteaBotwxiaoguang
andauthored
Rename CodeIndexerEnabled to IsRepoIndexerEnabled (go-gitea#30762) (go-gitea#30767)
Backport go-gitea#30762 by @wxiaoguang Fix go-gitea#30761 Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so it should always use `IsRepoIndexerEnabled` for consistency. Co-authored-by: wxiaoguang <[email protected]>
1 parent 6c86034 commit 6edee2e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

routers/web/repo/search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func Search(ctx *context.Context) {
8686
}
8787
}
8888

89-
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
89+
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
9090
ctx.Data["Repo"] = ctx.Repo.Repository
9191
ctx.Data["SearchResults"] = searchResults
9292
ctx.Data["SearchResultLanguages"] = searchResultLanguages

routers/web/repo/setting/setting.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func SettingsCtxData(ctx *context.Context) {
6565
signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath())
6666
ctx.Data["SigningKeyAvailable"] = len(signing) > 0
6767
ctx.Data["SigningSettings"] = setting.Repository.Signing
68-
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
68+
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
6969

7070
if ctx.Doer.IsAdmin {
7171
if setting.Indexer.RepoIndexerEnabled {
@@ -110,7 +110,7 @@ func SettingsPost(ctx *context.Context) {
110110
signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath())
111111
ctx.Data["SigningKeyAvailable"] = len(signing) > 0
112112
ctx.Data["SigningSettings"] = setting.Repository.Signing
113-
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
113+
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
114114

115115
repo := ctx.Repo.Repository
116116

templates/repo/settings/options.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@
739739
<form class="ui form" method="post">
740740
{{.CsrfTokenHtml}}
741741
<input type="hidden" name="action" value="admin_index">
742-
{{if .CodeIndexerEnabled}}
742+
{{if .IsRepoIndexerEnabled}}
743743
<h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
744744
<div class="inline fields">
745745
<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>

templates/shared/search/code/search.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p>
99
</div>
1010
{{else}}
11-
{{if not .CodeIndexerEnabled}}
11+
{{if not .IsRepoIndexerEnabled}}
1212
<div class="ui message">
1313
<p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p>
1414
</div>

0 commit comments

Comments
 (0)