struct git_attr *next;
unsigned h;
int attr_nr;
+ int maybe_macro;
char name[FLEX_ARRAY];
};
static int attr_nr;
a->h = hval;
a->next = git_attr_hash[pos];
a->attr_nr = attr_nr++;
+ a->maybe_macro = 0;
git_attr_hash[pos] = a;
REALLOC_ARRAY(check_all_attr, attr_nr);
sizeof(*res) +
sizeof(struct attr_state) * num_attr +
(is_macro ? 0 : namelen + 1));
- if (is_macro)
+ if (is_macro) {
res->u.attr = git_attr_internal(name, namelen);
- else {
+ res->u.attr->maybe_macro = 1;
+ } else {
char *p = (char *)&(res->state[num_attr]);
memcpy(p, name, namelen);
res->u.pat.pattern = p;
struct match_attr *a = NULL;
int i;
- if (check_all_attr[nr].value != ATTR__TRUE)
+ if (check_all_attr[nr].value != ATTR__TRUE ||
+ !check_all_attr[nr].attr->maybe_macro)
return rem;
for (stk = attr_stack; !a && stk; stk = stk->prev)