| 648 | } |
| 649 | |
| 650 | static int load_bitmap(struct repository *r, struct bitmap_index *bitmap_git, |
| 651 | int recursing) |
| 652 | { |
| 653 | assert(bitmap_git->map); |
| 654 | |
| 655 | bitmap_git->bitmaps = kh_init_oid_map(); |
| 656 | bitmap_git->ext_index.positions = kh_init_oid_pos(); |
| 657 | |
| 658 | if (load_reverse_index(r, bitmap_git)) |
| 659 | return -1; |
| 660 | |
| 661 | if (!(bitmap_git->commits = read_bitmap_1(bitmap_git)) || |
| 662 | !(bitmap_git->trees = read_bitmap_1(bitmap_git)) || |
| 663 | !(bitmap_git->blobs = read_bitmap_1(bitmap_git)) || |
| 664 | !(bitmap_git->tags = read_bitmap_1(bitmap_git))) |
| 665 | return -1; |
| 666 | |
| 667 | if (!bitmap_git->table_lookup && load_bitmap_entries_v1(bitmap_git) < 0) |
| 668 | return -1; |
| 669 | |
| 670 | if (bitmap_git->base) { |
| 671 | if (!bitmap_is_midx(bitmap_git)) |
| 672 | BUG("non-MIDX bitmap has non-NULL base bitmap index"); |
| 673 | if (load_bitmap(r, bitmap_git->base, 1) < 0) |
| 674 | return -1; |
| 675 | } |
| 676 | |
| 677 | if (!recursing) |
| 678 | load_all_type_bitmaps(bitmap_git); |
| 679 | |
| 680 | return 0; |
| 681 | } |
| 682 | |
| 683 | static int open_pack_bitmap(struct repository *r, |
| 684 | struct bitmap_index *bitmap_git) |
no test coverage detected