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

Function mark_edges_uninteresting

list-objects.c:283–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283void mark_edges_uninteresting(struct rev_info *revs,
284 show_edge_fn show_edge,
285 int sparse)
286{
287 struct commit_list *list;
288
289 if (sparse) {
290 struct oidset set;
291 oidset_init(&set, 16);
292
293 for (list = revs->commits; list; list = list->next) {
294 struct commit *commit = list->item;
295 struct tree *tree = repo_get_commit_tree(the_repository,
296 commit);
297
298 if (commit->object.flags & UNINTERESTING)
299 tree->object.flags |= UNINTERESTING;
300
301 oidset_insert(&set, &tree->object.oid);
302 add_edge_parents(commit, revs, show_edge, &set);
303 }
304
305 mark_trees_uninteresting_sparse(revs->repo, &set);
306 oidset_clear(&set);
307 } else {
308 for (list = revs->commits; list; list = list->next) {
309 struct commit *commit = list->item;
310 if (commit->object.flags & UNINTERESTING) {
311 mark_tree_uninteresting(revs->repo,
312 repo_get_commit_tree(the_repository, commit));
313 if (revs->edge_hint_aggressive && !(commit->object.flags & SHOWN)) {
314 commit->object.flags |= SHOWN;
315 show_edge(commit);
316 }
317 continue;
318 }
319 mark_edge_parents_uninteresting(commit, revs, show_edge);
320 }
321 }
322
323 if (revs->edge_hint_aggressive) {
324 for (size_t i = 0; i < revs->cmdline.nr; i++) {
325 struct object *obj = revs->cmdline.rev[i].item;
326 struct commit *commit = (struct commit *)obj;
327 if (obj->type != OBJ_COMMIT || !(obj->flags & UNINTERESTING))
328 continue;
329 mark_tree_uninteresting(revs->repo,
330 repo_get_commit_tree(the_repository, commit));
331 if (!(obj->flags & SHOWN)) {
332 obj->flags |= SHOWN;
333 show_edge(commit);
334 }
335 }
336 }
337}
338
339static void add_pending_tree(struct rev_info *revs, struct tree *tree)
340{

Callers 5

cmd_mainFunction · 0.85
bisect_commonFunction · 0.85
walk_objects_by_pathFunction · 0.85
cmd_rev_listFunction · 0.85
get_object_listFunction · 0.85

Calls 9

oidset_initFunction · 0.85
repo_get_commit_treeFunction · 0.85
oidset_insertFunction · 0.85
add_edge_parentsFunction · 0.85
oidset_clearFunction · 0.85
mark_tree_uninterestingFunction · 0.85
show_edgeFunction · 0.70

Tested by

no test coverage detected