From: Junio C Hamano Date: Wed, 18 Oct 2017 05:19:02 +0000 (+0900) Subject: Merge branch 'ik/userdiff-html-h-element-fix' into maint X-Git-Tag: v2.15.0-rc2~5^2~36 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/b8a4e894d42dd3b1c5dfa90e68ffaee5ab27dcc2?hp=-c Merge branch 'ik/userdiff-html-h-element-fix' into maint The built-in pattern to detect the "function header" for HTML did not match

..

elements without any attributes, which has been fixed. * ik/userdiff-html-h-element-fix: userdiff: fix HTML hunk header regexp --- b8a4e894d42dd3b1c5dfa90e68ffaee5ab27dcc2 diff --combined userdiff.c index 2c1502f719,4a0e5202e4..d314667220 --- a/userdiff.c +++ b/userdiff.c @@@ -1,5 -1,4 +1,5 @@@ #include "cache.h" +#include "config.h" #include "userdiff.h" #include "attr.h" @@@ -38,7 -37,7 +38,7 @@@ IPATTERN("fortran" "|//|\\*\\*|::|[/<>=]="), IPATTERN("fountain", "^((\\.[^.]|(int|ext|est|int\\.?/ext|i/e)[. ]).*)$", "[^ \t-]+"), - PATTERNS("html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$", + PATTERNS("html", "^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$", "[^<>= \t]+"), PATTERNS("java", "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n" @@@ -263,22 -262,25 +263,22 @@@ struct userdiff_driver *userdiff_find_b struct userdiff_driver *userdiff_find_by_path(const char *path) { - static struct git_attr *attr; - struct git_attr_check check; - - if (!attr) - attr = git_attr("diff"); - check.attr = attr; + static struct attr_check *check; + if (!check) + check = attr_check_initl("diff", NULL); if (!path) return NULL; - if (git_check_attr(path, 1, &check)) + if (git_check_attr(path, check)) return NULL; - if (ATTR_TRUE(check.value)) + if (ATTR_TRUE(check->items[0].value)) return &driver_true; - if (ATTR_FALSE(check.value)) + if (ATTR_FALSE(check->items[0].value)) return &driver_false; - if (ATTR_UNSET(check.value)) + if (ATTR_UNSET(check->items[0].value)) return NULL; - return userdiff_find_by_name(check.value); + return userdiff_find_by_name(check->items[0].value); } struct userdiff_driver *userdiff_get_textconv(struct userdiff_driver *driver)