* 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
| 1339 | * bits. |
| 1340 | */ |
| 1341 | static 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 | |
| 1353 | static int write_graph_chunk_generation_data(struct hashfile *f, |
| 1354 | void *data) |
no test coverage detected