diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:13:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-23 14:13:12 -0700 |
commit | 85c81a74e24fd83bbe7a75aa4ce6a5b3dfa1b884 (patch) | |
tree | c295552653e67bf20c475d955d78756a82c19f23 | |
parent | Merge branch 'kw/commit-keep-index-when-pre-commit-is-not-run' (diff) | |
parent | git-grep: correct exit code with --quiet and -L (diff) | |
download | tgif-85c81a74e24fd83bbe7a75aa4ce6a5b3dfa1b884.tar.xz |
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
-rw-r--r-- | grep.c | 2 | ||||
-rwxr-xr-x | t/t7810-grep.sh | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -1821,7 +1821,7 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle return 0; if (opt->status_only) - return 0; + return opt->unmatch_name_only; if (opt->unmatch_name_only) { /* We did not see any hit, so we want to show this */ show_name(opt, gs->name); diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh index f106387820..2a6679c2f5 100755 --- a/t/t7810-grep.sh +++ b/t/t7810-grep.sh @@ -374,6 +374,11 @@ test_expect_success 'grep -L -C' ' 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 file:foo mmap bar_mmap EOF |