grep: fix exit status if external_grep() punts
If external_grep() is called and punts, grep_cache() mistakenly reported a hit, even if there were none. The bug can be triggered by calling "git grep --no-color" from a subdirectory. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
e276f018f2
commit
929e37d3df
@ -448,6 +448,7 @@ static int grep_cache(struct grep_opt *opt, const char **paths, int cached)
|
|||||||
hit = external_grep(opt, paths, cached);
|
hit = external_grep(opt, paths, cached);
|
||||||
if (hit >= 0)
|
if (hit >= 0)
|
||||||
return hit;
|
return hit;
|
||||||
|
hit = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user