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

Function mark_trees_uninteresting_sparse

revision.c:213–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213void mark_trees_uninteresting_sparse(struct repository *r,
214 struct oidset *trees)
215{
216 unsigned has_interesting = 0, has_uninteresting = 0;
217 struct hashmap map = HASHMAP_INIT(path_and_oids_cmp, NULL);
218 struct hashmap_iter map_iter;
219 struct path_and_oids_entry *entry;
220 struct object_id *oid;
221 struct oidset_iter iter;
222
223 oidset_iter_init(trees, &iter);
224 while ((!has_interesting || !has_uninteresting) &&
225 (oid = oidset_iter_next(&iter))) {
226 struct tree *tree = lookup_tree(r, oid);
227
228 if (!tree)
229 continue;
230
231 if (tree->object.flags & UNINTERESTING)
232 has_uninteresting = 1;
233 else
234 has_interesting = 1;
235 }
236
237 /* Do not walk unless we have both types of trees. */
238 if (!has_uninteresting || !has_interesting)
239 return;
240
241 oidset_iter_init(trees, &iter);
242 while ((oid = oidset_iter_next(&iter))) {
243 struct tree *tree = lookup_tree(r, oid);
244 add_children_by_path(r, tree, &map);
245 }
246
247 hashmap_for_each_entry(&map, &map_iter, entry, ent /* member name */)
248 mark_trees_uninteresting_sparse(r, &entry->trees);
249
250 paths_and_oids_clear(&map);
251}
252
253static void mark_one_parent_uninteresting(struct rev_info *revs, struct commit *commit,
254 struct commit_stack *pending)

Callers 1

mark_edges_uninterestingFunction · 0.85

Calls 5

oidset_iter_initFunction · 0.85
oidset_iter_nextFunction · 0.85
lookup_treeFunction · 0.85
add_children_by_pathFunction · 0.85
paths_and_oids_clearFunction · 0.85

Tested by

no test coverage detected