Skip to content

Commit

Permalink
fix grep search
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Jan 15, 2025
1 parent 7866959 commit c89ddae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/web/repo/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func Search(ctx *context.Context) {
res, err := git.GrepSearch(ctx, ctx.Repo.GitRepo, prepareSearch.Keyword, git.GrepOptions{
ContextLineNumber: 1,
IsFuzzy: prepareSearch.IsFuzzy,
RefName: git.RefNameFromBranch(ctx.Repo.BranchName).String(), // BranchName should be default branch or the first existing branch
RefName: git.RefNameFromBranch(ctx.Repo.Repository.DefaultBranch).String(), // BranchName should be default branch or the first existing branch
PathspecList: indexSettingToGitGrepPathspecList(),
})
if err != nil {
Expand Down

0 comments on commit c89ddae

Please sign in to comment.