summaryrefslogtreecommitdiff
path: root/t/t7008-grep-binary.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-05-10 15:10:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-10 17:27:31 (GMT)
commit335ec3bf411ae6606b58885deb281192c86651c6 (patch)
tree4a53330db9ad34bcfb57588215142839ac8993e8 /t/t7008-grep-binary.sh
parent97f6a9c975bb14688b60a5134069159b4cae1a07 (diff)
downloadgit-335ec3bf411ae6606b58885deb281192c86651c6.zip
git-335ec3bf411ae6606b58885deb281192c86651c6.tar.gz
git-335ec3bf411ae6606b58885deb281192c86651c6.tar.bz2
grep: allow to use textconv filters
Recently and not so recently, we made sure that log/grep type operations use textconv filters when a userfacing diff would do the same: ef90ab6 (pickaxe: use textconv for -S counting, 2012-10-28) b1c2f57 (diff_grep: use textconv buffers for add/deleted files, 2012-10-28) 0508fe5 (combine-diff: respect textconv attributes, 2011-05-23) "git grep" currently does not use textconv filters at all, that is neither for displaying the match and context nor for the actual grepping, even when requested by --textconv. Introduce an option "--textconv" which makes git grep use any configured textconv filters for grepping and output purposes. It is off by default. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> 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, 5 insertions, 1 deletions
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh
index 1c0946f..a91260a 100755
--- a/t/t7008-grep-binary.sh
+++ b/t/t7008-grep-binary.sh
@@ -160,7 +160,7 @@ test_expect_success 'grep does not honor textconv' '
test_must_fail git grep Qfile
'
-test_expect_failure 'grep --textconv honors textconv' '
+test_expect_success 'grep --textconv honors textconv' '
echo "a:binaryQfile" >expect &&
git grep --textconv Qfile >actual &&
test_cmp expect actual
@@ -176,4 +176,8 @@ test_expect_failure 'grep --textconv blob honors textconv' '
test_cmp expect actual
'
+test_expect_success 'grep --no-textconv blob does not honor textconv' '
+ test_must_fail git grep --no-textconv Qfile HEAD:a
+'
+
test_done