| 534 | } |
| 535 | |
| 536 | static int write_midx_oid_lookup(struct hashfile *f, |
| 537 | void *data) |
| 538 | { |
| 539 | struct write_midx_context *ctx = data; |
| 540 | unsigned char hash_len = ctx->repo->hash_algo->rawsz; |
| 541 | struct pack_midx_entry *list = ctx->entries; |
| 542 | uint32_t i; |
| 543 | |
| 544 | for (i = 0; i < ctx->entries_nr; i++) { |
| 545 | struct pack_midx_entry *obj = list++; |
| 546 | |
| 547 | if (i < ctx->entries_nr - 1) { |
| 548 | struct pack_midx_entry *next = list; |
| 549 | if (oidcmp(&obj->oid, &next->oid) >= 0) |
| 550 | BUG("OIDs not in order: %s >= %s", |
| 551 | oid_to_hex(&obj->oid), |
| 552 | oid_to_hex(&next->oid)); |
| 553 | } |
| 554 | |
| 555 | hashwrite(f, obj->oid.hash, (int)hash_len); |
| 556 | } |
| 557 | |
| 558 | return 0; |
| 559 | } |
| 560 | |
| 561 | static int write_midx_object_offsets(struct hashfile *f, |
| 562 | void *data) |
nothing calls this directly
no test coverage detected