mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-23 09:30:50 +00:00
fix: make test suite run on older git version (#8188)
Ref: forgejo/forgejo#8140, forgejo/forgejo#8144 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8188 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
53d5e6d754
commit
90f8239448
7 changed files with 71 additions and 46 deletions
|
@ -98,8 +98,7 @@ func GrepSearch(ctx context.Context, repo *Repository, search string, opts GrepO
|
|||
|
||||
cmd.AddOptionValues("--context", fmt.Sprint(opts.ContextLineNumber))
|
||||
|
||||
// --max-count requires at least git 2.38
|
||||
if CheckGitVersionAtLeast("2.38.0") == nil {
|
||||
if SupportGrepMaxCount {
|
||||
cmd.AddOptionValues("--max-count", fmt.Sprint(opts.MatchesPerFile))
|
||||
} else {
|
||||
log.Warn("git-grep: --max-count requires at least git 2.38")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue