summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2017-08-17 18:38:51 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-17 19:02:23 -0700
commite1f68c66d575e09f325f3eda9ced1b2f4ef4b4f0 (patch)
tree4b267159f350ad35be2a068509f4da11d04c799f /grep.c
parent3d9c5b5c4461957fbbc0479e037990db04ebb740 (diff)
downloadgit-e1f68c66d575e09f325f3eda9ced1b2f4ef4b4f0.tar.gz
git-grep: correct exit code with --quiet and -Las/grep-quiet-no-match-exit-code-fix
The handling of `status_only` no longer interferes with the handling of `unmatch_name_only`. `--quiet` no longer affects the exit code when using `-L`/`--files-without-match`. Signed-off-by: Anthony Sottile <asottile@umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/grep.c b/grep.c
index 0dbdc1d007..3b29fbde2f 100644
--- a/grep.c
+++ b/grep.c
@@ -1629,7 +1629,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);