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:
Clemens Buchacher 2009-09-07 10:48:01 +02:00 committed by Junio C Hamano
parent e276f018f2
commit 929e37d3df

View file

@ -448,6 +448,7 @@ static int grep_cache(struct grep_opt *opt, const char **paths, int cached)
hit = external_grep(opt, paths, cached);
if (hit >= 0)
return hit;
hit = 0;
}
#endif