Skip to content

Commit

Permalink
Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762)
Browse files Browse the repository at this point in the history
Fix  #30761

Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so
it should always use `IsRepoIndexerEnabled` for consistency.
  • Loading branch information
wxiaoguang authored Apr 29, 2024
1 parent a21ca9b commit 4daea7c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion routers/web/repo/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Search(ctx *context.Context) {
}
}

ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["Repo"] = ctx.Repo.Repository
ctx.Data["SearchResults"] = searchResults
ctx.Data["SearchResultLanguages"] = searchResultLanguages
Expand Down
4 changes: 2 additions & 2 deletions routers/web/repo/setting/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func SettingsCtxData(ctx *context.Context) {
signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath())
ctx.Data["SigningKeyAvailable"] = len(signing) > 0
ctx.Data["SigningSettings"] = setting.Repository.Signing
ctx.Data["CodeIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled

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

repo := ctx.Repo.Repository

Expand Down
2 changes: 1 addition & 1 deletion templates/repo/settings/options.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@
<form class="ui form" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="admin_index">
{{if .CodeIndexerEnabled}}
{{if .IsRepoIndexerEnabled}}
<h4 class="ui header">{{ctx.Locale.Tr "repo.settings.admin_code_indexer"}}</h4>
<div class="inline fields">
<label>{{ctx.Locale.Tr "repo.settings.admin_indexer_commit_sha"}}</label>
Expand Down
2 changes: 1 addition & 1 deletion templates/shared/search/code/search.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p>
</div>
{{else}}
{{if not .CodeIndexerEnabled}}
{{if not .IsRepoIndexerEnabled}}
<div class="ui message">
<p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p>
</div>
Expand Down

0 comments on commit 4daea7c

Please sign in to comment.