| 34 | const char *idx_name); |
| 35 | |
| 36 | static size_t write_midx_header(const struct git_hash_algo *hash_algo, |
| 37 | struct hashfile *f, unsigned char num_chunks, |
| 38 | uint32_t num_packs, int version) |
| 39 | { |
| 40 | if (version != MIDX_VERSION_V1 && version != MIDX_VERSION_V2) |
| 41 | BUG("unexpected MIDX version: %d", version); |
| 42 | |
| 43 | hashwrite_be32(f, MIDX_SIGNATURE); |
| 44 | hashwrite_u8(f, version); |
| 45 | hashwrite_u8(f, oid_version(hash_algo)); |
| 46 | hashwrite_u8(f, num_chunks); |
| 47 | hashwrite_u8(f, 0); /* unused */ |
| 48 | hashwrite_be32(f, num_packs); |
| 49 | |
| 50 | return MIDX_HEADER_SIZE; |
| 51 | } |
| 52 | |
| 53 | struct pack_info { |
| 54 | uint32_t orig_pack_int_id; |
no test coverage detected