| 285 | } |
| 286 | |
| 287 | uint32_t get_pack_fanout(struct packed_git *p, uint32_t value) |
| 288 | { |
| 289 | const uint32_t *level1_ofs = p->index_data; |
| 290 | |
| 291 | if (!level1_ofs) { |
| 292 | if (open_pack_index(p)) |
| 293 | return 0; |
| 294 | level1_ofs = p->index_data; |
| 295 | } |
| 296 | |
| 297 | if (p->index_version > 1) { |
| 298 | level1_ofs += 2; |
| 299 | } |
| 300 | |
| 301 | return ntohl(level1_ofs[value]); |
| 302 | } |
| 303 | |
| 304 | static struct packed_git *alloc_packed_git(struct repository *r, int extra) |
| 305 | { |
no test coverage detected