Merge branch 'js/chain-lint-attrfix'
[gitweb.git] / userdiff.c
index a69241b25ddaff5b61380aa8b451a6fcb833502c..f3f4be579c9810d0fcf94badd4bf21770b99c91b 100644 (file)
@@ -114,7 +114,7 @@ PATTERNS("perl",
         "|<<|<>|<=>|>>"),
 PATTERNS("php",
         "^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
-        "^[\t ]*(class.*)$",
+        "^[\t ]*((((final|abstract)[\t ]+)?class|interface|trait).*)$",
         /* -- */
         "[a-zA-Z_][a-zA-Z0-9_]*"
         "|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+"
@@ -278,7 +278,7 @@ struct userdiff_driver *userdiff_find_by_path(const char *path)
                check = attr_check_initl("diff", NULL);
        if (!path)
                return NULL;
-       if (git_check_attr(path, check))
+       if (git_check_attr(&the_index, path, check))
                return NULL;
 
        if (ATTR_TRUE(check->items[0].value))