Code

Merge branch 'maint-1.6.3' into maint
[git.git] / t / t7002-grep.sh
index ef59ab9941ffb3bafc0bd45ebbee02e7a117c527..b13aa7e89ad51566979ab674baa2ac36c7e33da6 100755 (executable)
@@ -243,12 +243,25 @@ test_expect_success 'grep with CE_VALID file' '
        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
 '