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

Function compute_generation_offset

commit-graph.c:1341–1351  ·  view source on GitHub ↗

* Compute the generation offset between the commit date and its generation. * This is what's ultimately stored as generation number in the commit graph. * * Note that the computation of the commit date is more involved than you might * think. Instead of using the full commit date, we're in fact masking bits so * that only the 34 lowest bits are considered. This results from the fact that * c

Source from the content-addressed store, hash-verified

1339 * bits.
1340 */
1341static timestamp_t compute_generation_offset(struct commit *c)
1342{
1343 timestamp_t masked_date;
1344
1345 if (sizeof(timestamp_t) > 4)
1346 masked_date = c->date & (((timestamp_t) 1 << 34) - 1);
1347 else
1348 masked_date = c->date;
1349
1350 return commit_graph_data_at(c)->generation - masked_date;
1351}
1352
1353static int write_graph_chunk_generation_data(struct hashfile *f,
1354 void *data)

Calls 1

commit_graph_data_atFunction · 0.85

Tested by

no test coverage detected