From: Michael J Gruber Date: Tue, 23 Apr 2013 12:11:56 GMT Subject: [PATCHv2 4/7] t7008: demonstrate behavior of grep with textconv Message-ID: <5137a5a48ae6c70ad716d985a22d53ec311ee05a.1366718624.git.git@drmicha.warpmail.net> In-Reply-To: <517298D4.3030802@drmicha.warpmail.net> Currently, "git grep" does not honor any textconv filters. Demonstrate this in the tests. Signed-off-by: Michael J Gruber --- t/t7008-grep-binary.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh index 26f8319..126fe4c 100755 --- a/t/t7008-grep-binary.sh +++ b/t/t7008-grep-binary.sh @@ -145,4 +145,27 @@ test_expect_success 'grep respects not-binary diff attribute' ' test_cmp expect actual ' +cat >nul_to_q_textconv <<'EOF' +#!/bin/sh +"$PERL_PATH" -pe 'y/\000/Q/' < "$1" +EOF +chmod +x nul_to_q_textconv + +test_expect_success 'setup textconv filters' ' + echo a diff=foo >.gitattributes && + git config diff.foo.textconv "\"$(pwd)\""/nul_to_q_textconv +' + +test_expect_failure 'grep does not honor textconv' ' + echo "a:binaryQfile" >expect && + git grep Qfile >actual && + test_cmp expect actual +' + +test_expect_failure 'grep blob does not honor textconv' ' + echo "HEAD:a:binaryQfile" >expect && + git grep Qfile HEAD:a >actual && + test_cmp expect actual +' + test_done -- 1.8.2.1.799.g1ac2534