mirror of
https://github.com/git/git
synced 2024-08-27 03:29:21 +00:00
Merge branch 'as/grep-quiet-no-match-exit-code-fix'
"git grep -L" and "git grep --quiet -L" reported different exit codes; this has been corrected. * as/grep-quiet-no-match-exit-code-fix: git-grep: correct exit code with --quiet and -L
This commit is contained in:
commit
85c81a74e2
2
grep.c
2
grep.c
|
@ -1821,7 +1821,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (opt->status_only)
|
if (opt->status_only)
|
||||||
return 0;
|
return opt->unmatch_name_only;
|
||||||
if (opt->unmatch_name_only) {
|
if (opt->unmatch_name_only) {
|
||||||
/* We did not see any hit, so we want to show this */
|
/* We did not see any hit, so we want to show this */
|
||||||
show_name(opt, gs->name);
|
show_name(opt, gs->name);
|
||||||
|
|
|
@ -374,6 +374,11 @@ test_expect_success 'grep -L -C' '
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'grep --files-without-match --quiet' '
|
||||||
|
git grep --files-without-match --quiet nonexistent_string >actual &&
|
||||||
|
test_cmp /dev/null actual
|
||||||
|
'
|
||||||
|
|
||||||
cat >expected <<EOF
|
cat >expected <<EOF
|
||||||
file:foo mmap bar_mmap
|
file:foo mmap bar_mmap
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in a new issue