]> git.ipfire.org Git - thirdparty/git.git/blobdiff - grep.c
Merge branch 'ab/grep-simplify-extended-expression'
[thirdparty/git.git] / grep.c
diff --git a/grep.c b/grep.c
index 27e1db0fe1ec8de26bbb0b3b7e20463fd1f3e9ce..06eed694936c93a0b0d00c993f0a7c068a71916e 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -1614,7 +1614,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
                                return 0;
                        goto next_line;
                }
-               if (hit) {
+               if (hit && (opt->max_count < 0 || count < opt->max_count)) {
                        count++;
                        if (opt->status_only)
                                return 1;