MCPcopy Index your code
hub / github.com/git/git / remove_redundant

Function remove_redundant

commit-reach.c:458–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static int remove_redundant(struct repository *r, struct commit **array,
459 size_t cnt, size_t *dedup_cnt)
460{
461 /*
462 * Some commit in the array may be an ancestor of
463 * another commit. Move the independent commits to the
464 * beginning of 'array' and return their number. Callers
465 * should not rely upon the contents of 'array' after
466 * that number.
467 */
468 if (generation_numbers_enabled(r)) {
469 /*
470 * If we have a single commit with finite generation
471 * number, then the _with_gen algorithm is preferred.
472 */
473 for (size_t i = 0; i < cnt; i++) {
474 if (commit_graph_generation(array[i]) < GENERATION_NUMBER_INFINITY)
475 return remove_redundant_with_gen(r, array, cnt, dedup_cnt);
476 }
477 }
478
479 return remove_redundant_no_gen(r, array, cnt, dedup_cnt);
480}
481
482static int get_merge_bases_many_0(struct repository *r,
483 struct commit *one,

Callers 2

get_merge_bases_many_0Function · 0.85
reduce_headsFunction · 0.85

Calls 4

commit_graph_generationFunction · 0.85
remove_redundant_no_genFunction · 0.85

Tested by

no test coverage detected