diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2010-05-22 23:30:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-24 11:22:06 -0700 |
commit | 321ffcc0556a94c461ac84667b35494c193804ec (patch) | |
tree | 778d9cb2c32331cadec7200349c52b440d5947a7 /t | |
parent | grep: --count over binary (diff) | |
download | tgif-321ffcc0556a94c461ac84667b35494c193804ec.tar.xz |
grep: --name-only over binary
As with the option -c/--count, git grep with the option -l/--name-only
should work the same with binary files as with text files because
there is no danger of messing up the terminal with control characters
from the contents of matching files. GNU grep does the same.
Move the check for ->name_only before the one for binary_match_only,
thus making the latter irrelevant for git grep -l.
Reported-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7008-grep-binary.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh index 91970eacd6..4a12d97922 100755 --- a/t/t7008-grep-binary.sh +++ b/t/t7008-grep-binary.sh @@ -33,6 +33,12 @@ test_expect_success 'git grep -c ina a' ' test_cmp expect actual ' +test_expect_success 'git grep -l ina a' ' + echo a >expect && + git grep -l ina a >actual && + test_cmp expect actual +' + test_expect_success 'git grep -L bar a' ' echo a >expect && git grep -L bar a >actual && |