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

Function fill

attr.c:1117–1136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1115}
1116
1117static int fill(const char *path, int pathlen, int basename_offset,
1118 const struct attr_stack *stack,
1119 struct all_attrs_item *all_attrs, int rem)
1120{
1121 for (; rem > 0 && stack; stack = stack->prev) {
1122 unsigned i;
1123 const char *base = stack->origin ? stack->origin : "";
1124
1125 for (i = stack->num_matches; 0 < rem && 0 < i; i--) {
1126 const struct match_attr *a = stack->attrs[i - 1];
1127 if (a->is_macro)
1128 continue;
1129 if (path_matches(path, pathlen, basename_offset,
1130 &a->u.pat, base, stack->originlen))
1131 rem = fill_one(all_attrs, a, rem);
1132 }
1133 }
1134
1135 return rem;
1136}
1137
1138/*
1139 * Marks the attributes which are macros based on the attribute stack.

Callers 1

collect_some_attrsFunction · 0.70

Calls 2

path_matchesFunction · 0.85
fill_oneFunction · 0.85

Tested by

no test coverage detected