diff --git a/t/t7810-grep.sh b/t/t7810-grep.sh
index 81263b78516cbe2949ad7e426a5e44af188cccdd..7ba5b16f99443c0dc5aaff8fbb4ce4ad8874a27c 100755 (executable)
--- a/t/t7810-grep.sh
+++ b/t/t7810-grep.sh
test_cmp expected actual
'
test_cmp expected actual
'
+cat >expected <<EOF
+hello.c= printf("Hello world.\n");
+hello.c: return 0;
+hello.c- /* char ?? */
+EOF
+
+test_expect_success 'grep -W with userdiff' '
+ test_when_finished "rm -f .gitattributes" &&
+ git config diff.custom.xfuncname "(printf.*|})$" &&
+ echo "hello.c diff=custom" >.gitattributes &&
+ git grep -W return >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'grep from a subdirectory to search wider area (1)' '
mkdir -p s &&
(
test_expect_success 'grep from a subdirectory to search wider area (1)' '
mkdir -p s &&
(