| 1351 | } |
| 1352 | |
| 1353 | static int write_graph_chunk_generation_data(struct hashfile *f, |
| 1354 | void *data) |
| 1355 | { |
| 1356 | struct write_commit_graph_context *ctx = data; |
| 1357 | int i, num_generation_data_overflows = 0; |
| 1358 | |
| 1359 | for (i = 0; i < ctx->commits.nr; i++) { |
| 1360 | struct commit *c = ctx->commits.items[i]; |
| 1361 | timestamp_t offset; |
| 1362 | repo_parse_commit(ctx->r, c); |
| 1363 | offset = compute_generation_offset(c); |
| 1364 | display_progress(ctx->progress, ++ctx->progress_cnt); |
| 1365 | |
| 1366 | if (offset > GENERATION_NUMBER_V2_OFFSET_MAX) { |
| 1367 | offset = CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW | num_generation_data_overflows; |
| 1368 | num_generation_data_overflows++; |
| 1369 | } |
| 1370 | |
| 1371 | hashwrite_be32(f, offset); |
| 1372 | } |
| 1373 | |
| 1374 | return 0; |
| 1375 | } |
| 1376 | |
| 1377 | static int write_graph_chunk_generation_data_overflow(struct hashfile *f, |
| 1378 | void *data) |
nothing calls this directly
no test coverage detected