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

Function compute_generation_from_max

commit-graph.c:1630–1648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1628};
1629
1630static timestamp_t compute_generation_from_max(struct commit *c,
1631 timestamp_t max_gen,
1632 int generation_version)
1633{
1634 switch (generation_version) {
1635 case 1: /* topological levels */
1636 if (max_gen > GENERATION_NUMBER_V1_MAX - 1)
1637 max_gen = GENERATION_NUMBER_V1_MAX - 1;
1638 return max_gen + 1;
1639
1640 case 2: /* corrected commit date */
1641 if (c->date && c->date > max_gen)
1642 max_gen = c->date - 1;
1643 return max_gen + 1;
1644
1645 default:
1646 BUG("attempting unimplemented version");
1647 }
1648}
1649
1650static void compute_reachable_generation_numbers(
1651 struct compute_generation_info *info,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected