summaryrefslogtreecommitdiff
path: root/t/t7008-grep-binary.sh
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2010-05-22 21:30:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-05-24 18:22:06 (GMT)
commit321ffcc0556a94c461ac84667b35494c193804ec (patch)
tree778d9cb2c32331cadec7200349c52b440d5947a7 /t/t7008-grep-binary.sh
parentc30c10cff1d640ce119596b907c10cc11f83358d (diff)
downloadgit-321ffcc0556a94c461ac84667b35494c193804ec.zip
git-321ffcc0556a94c461ac84667b35494c193804ec.tar.gz
git-321ffcc0556a94c461ac84667b35494c193804ec.tar.bz2
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/t7008-grep-binary.sh')
-rwxr-xr-xt/t7008-grep-binary.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh
index 91970ea..4a12d97 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 &&