diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index ef59ab9941ffb3bafc0bd45ebbee02e7a117c527..b13aa7e89ad51566979ab674baa2ac36c7e33da6 100755 (executable)
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
git checkout t/t
'
+cat >expected <<EOF
+hello.c=#include <stdio.h>
+hello.c: return 0;
+EOF
+
+test_expect_success 'grep -p with userdiff' '
+ git config diff.custom.funcname "^#" &&
+ echo "hello.c diff=custom" >.gitattributes &&
+ git grep -p return >actual &&
+ test_cmp expected actual
+'
+
cat >expected <<EOF
hello.c=int main(int argc, const char **argv)
hello.c: return 0;
EOF
test_expect_success 'grep -p' '
+ rm -f .gitattributes &&
git grep -p return >actual &&
test_cmp expected actual
'