MCPcopy Create free account
hub / github.com/git/git / fill_one

Function fill_one

attr.c:1092–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1090}
1091
1092static 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
1117static int fill(const char *path, int pathlen, int basename_offset,
1118 const struct attr_stack *stack,

Callers 1

fillFunction · 0.85

Calls 3

attr_state_queue_pushFunction · 0.85
attr_state_queue_popFunction · 0.85
attr_state_queue_releaseFunction · 0.85

Tested by

no test coverage detected