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 'git-grep: ensure bounded default for MatchesPerFile' (#4928) from yoctozepto/forgejo:git-grep-limit-matches-per-file into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4928
Reviewed-by: Shiny Nematoda <snematoda@noreply.codeberg.org>
Reviewed-by: Otto <otto@codeberg.org>

Otto 4132b18e b7fcc5e2

+2 -3
+2 -3
modules/git/grep.go
··· 68 68 "-I", "--null", "--break", "--heading", "--column", 69 69 "--fixed-strings", "--line-number", "--ignore-case", "--full-name") 70 70 cmd.AddOptionValues("--context", fmt.Sprint(opts.ContextLineNumber)) 71 - if opts.MatchesPerFile > 0 { 72 - cmd.AddOptionValues("--max-count", fmt.Sprint(opts.MatchesPerFile)) 73 - } 71 + opts.MatchesPerFile = cmp.Or(opts.MatchesPerFile, 20) 72 + cmd.AddOptionValues("--max-count", fmt.Sprint(opts.MatchesPerFile)) 74 73 words := []string{search} 75 74 if opts.IsFuzzy { 76 75 words = strings.Fields(search)