| 1090 | } |
| 1091 | |
| 1092 | static int fill_one(struct all_attrs_item *all_attrs, |
| 1093 | const struct match_attr *a, int rem) |
| 1094 | { |
| 1095 | struct attr_state_queue todo = { 0 }; |
| 1096 | const struct attr_state *state; |
| 1097 | |
| 1098 | attr_state_queue_push(&todo, a); |
| 1099 | while (rem > 0 && (state = attr_state_queue_pop(&todo))) { |
| 1100 | const struct git_attr *attr = state->attr; |
| 1101 | const char **n = &(all_attrs[attr->attr_nr].value); |
| 1102 | const char *v = state->setto; |
| 1103 | |
| 1104 | if (*n == ATTR__UNKNOWN) { |
| 1105 | const struct all_attrs_item *item = |
| 1106 | &all_attrs[attr->attr_nr]; |
| 1107 | *n = v; |
| 1108 | rem--; |
| 1109 | if (item->macro && item->value == ATTR__TRUE) |
| 1110 | attr_state_queue_push(&todo, item->macro); |
| 1111 | } |
| 1112 | } |
| 1113 | attr_state_queue_release(&todo); |
| 1114 | return rem; |
| 1115 | } |
| 1116 | |
| 1117 | static int fill(const char *path, int pathlen, int basename_offset, |
| 1118 | const struct attr_stack *stack, |
no test coverage detected