From: Junio C Hamano Date: Mon, 11 Mar 2019 07:16:24 +0000 (+0900) Subject: Merge branch 'rd/attr.c-comment-typofix' X-Git-Tag: v2.22.0-rc0~154 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0f519aba51645d26431ce716e4136dc47dbba925?ds=inline;hp=-c Merge branch 'rd/attr.c-comment-typofix' In-code comment typofix. * rd/attr.c-comment-typofix: attr.c: ".gitattribute" -> ".gitattributes" (comments) --- 0f519aba51645d26431ce716e4136dc47dbba925 diff --combined attr.c index fdd110bec5,9aa29ef6ef..93dc16b59c --- a/attr.c +++ b/attr.c @@@ -7,6 -7,7 +7,6 @@@ * an insanely large number of attributes. */ -#define NO_THE_INDEX_COMPATIBILITY_MACROS #include "cache.h" #include "config.h" #include "exec-cmd.h" @@@ -365,8 -366,8 +365,8 @@@ static struct match_attr *parse_attr_li if (strlen(ATTRIBUTE_MACRO_PREFIX) < namelen && starts_with(name, ATTRIBUTE_MACRO_PREFIX)) { if (!macro_ok) { - fprintf(stderr, "%s not allowed: %s:%d\n", - name, src, lineno); + fprintf_ln(stderr, _("%s not allowed: %s:%d"), + name, src, lineno); goto fail_return; } is_macro = 1; @@@ -431,14 -432,14 +431,14 @@@ fail_return * Like info/exclude and .gitignore, the attribute information can * come from many places. * - * (1) .gitattribute file of the same directory; - * (2) .gitattribute file of the parent directory if (1) does not have + * (1) .gitattributes file of the same directory; + * (2) .gitattributes file of the parent directory if (1) does not have * any match; this goes recursively upwards, just like .gitignore. * (3) $GIT_DIR/info/attributes, which overrides both of the above. * * In the same file, later entries override the earlier match, so in the * global list, we would have entries from info/attributes the earliest - * (reading the file from top to bottom), .gitattribute of the root + * (reading the file from top to bottom), .gitattributes of the root * directory (again, reading the file from top to bottom) down to the * current directory, and then scan the list backwards to find the first match. * This is exactly the same as what is_excluded() does in dir.c to deal with @@@ -899,7 -900,7 +899,7 @@@ static void prepare_attr_stack(const st * set of attribute definitions, followed by the contents * of $(prefix)/etc/gitattributes and a file specified by * core.attributesfile. Then, contents from - * .gitattribute files from directories closer to the + * .gitattributes files from directories closer to the * root to the ones in deeper directories are pushed * to the stack. Finally, at the very top of the stack * we always keep the contents of $GIT_DIR/info/attributes. @@@ -1091,7 -1092,7 +1091,7 @@@ static void collect_some_attrs(const st const char *path, struct attr_check *check) { - int i, pathlen, rem, dirlen; + int pathlen, rem, dirlen; const char *cp, *last_slash = NULL; int basename_offset; @@@ -1112,6 -1113,20 +1112,6 @@@ all_attrs_init(&g_attr_hashmap, check); determine_macros(check->all_attrs, check->stack); - if (check->nr) { - rem = 0; - for (i = 0; i < check->nr; i++) { - int n = check->items[i].attr->attr_nr; - struct all_attrs_item *item = &check->all_attrs[n]; - if (item->macro) { - item->value = ATTR__UNSET; - rem++; - } - } - if (rem == check->nr) - return; - } - rem = check->all_attrs_nr; fill(path, pathlen, basename_offset, check->stack, check->all_attrs, rem); }