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

Function compute_generation_numbers

commit-graph.c:1746–1780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1744}
1745
1746static void compute_generation_numbers(struct write_commit_graph_context *ctx)
1747{
1748 int i;
1749 struct compute_generation_info info = {
1750 .r = ctx->r,
1751 .commits = &ctx->commits,
1752 .get_generation = get_generation_from_graph_data,
1753 .set_generation = set_generation_v2,
1754 };
1755
1756 if (ctx->report_progress)
1757 info.progress = ctx->progress
1758 = start_delayed_progress(
1759 ctx->r,
1760 _("Computing commit graph generation numbers"),
1761 ctx->commits.nr);
1762
1763 if (!ctx->trust_generation_numbers) {
1764 for (i = 0; i < ctx->commits.nr; i++) {
1765 struct commit *c = ctx->commits.items[i];
1766 repo_parse_commit(ctx->r, c);
1767 commit_graph_data_at(c)->generation = GENERATION_NUMBER_ZERO;
1768 }
1769 }
1770
1771 compute_reachable_generation_numbers(&info, 2);
1772
1773 for (i = 0; i < ctx->commits.nr; i++) {
1774 struct commit *c = ctx->commits.items[i];
1775 timestamp_t offset = compute_generation_offset(c);
1776 if (offset > GENERATION_NUMBER_V2_OFFSET_MAX)
1777 ctx->num_generation_data_overflows++;
1778 }
1779 stop_progress(&ctx->progress);
1780}
1781
1782static void set_generation_in_graph_data(struct commit *c, timestamp_t t,
1783 void *data UNUSED)

Callers 1

write_commit_graphFunction · 0.85

Calls 6

start_delayed_progressFunction · 0.85
repo_parse_commitFunction · 0.85
commit_graph_data_atFunction · 0.85
stop_progressFunction · 0.85

Tested by

no test coverage detected