[PATCH 4/6] t7008: demonstrate behavior of grep with textconv
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Apr 19, 2013, 16:44 UTC
- Message-ID
- <b5e2a5d967855df362319edfb511686236b176ad.1366389739.git.git@drmicha.warpmail.net>
- In-Reply-To
- <cover.1366389739.git.git@drmicha.warpmail.net>
Currently, "git grep" does not invoke any textconv filters. Demonstrate this in the tests.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> --- t/t7008-grep-binary.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh index 26f8319..a1fd0b2 100755 --- a/t/t7008-grep-binary.sh +++ b/t/t7008-grep-binary.sh @@ -145,4 +145,23 @@ 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_success 'grep does not obey textconv' ' + test_must_fail git grep Qfile +' + +test_expect_success 'grep blob does not obey textconv' ' + test_must_fail git grep Qfile HEAD:a +' + test_done
-- 1.8.2.1.728.ge98e8b0