| 2888 | } |
| 2889 | |
| 2890 | int test_bitmap_commits_with_offset(struct repository *r) |
| 2891 | { |
| 2892 | struct object_id oid; |
| 2893 | struct stored_bitmap *stored; |
| 2894 | struct bitmap_index *bitmap_git; |
| 2895 | size_t commit_idx_pos_map_pos, xor_offset_map_pos, flag_map_pos, |
| 2896 | ewah_bitmap_map_pos; |
| 2897 | |
| 2898 | bitmap_git = prepare_bitmap_git(r); |
| 2899 | if (!bitmap_git) |
| 2900 | die(_("failed to load bitmap indexes")); |
| 2901 | |
| 2902 | /* |
| 2903 | * Since this function needs to know the position of each individual |
| 2904 | * bitmap, bypass the commit lookup table (if one exists) by forcing |
| 2905 | * the bitmap to eagerly load its entries. |
| 2906 | */ |
| 2907 | if (bitmap_git->table_lookup) { |
| 2908 | if (load_bitmap_entries_v1(bitmap_git) < 0) |
| 2909 | die(_("failed to load bitmap indexes")); |
| 2910 | } |
| 2911 | |
| 2912 | kh_foreach (bitmap_git->bitmaps, oid, stored, { |
| 2913 | commit_idx_pos_map_pos = stored->map_pos; |
| 2914 | xor_offset_map_pos = stored->map_pos + sizeof(uint32_t); |
| 2915 | flag_map_pos = xor_offset_map_pos + sizeof(uint8_t); |
| 2916 | ewah_bitmap_map_pos = flag_map_pos + sizeof(uint8_t); |
| 2917 | |
| 2918 | printf_ln("%s %"PRIuMAX" %"PRIuMAX" %"PRIuMAX" %"PRIuMAX, |
| 2919 | oid_to_hex(&oid), |
| 2920 | (uintmax_t)commit_idx_pos_map_pos, |
| 2921 | (uintmax_t)xor_offset_map_pos, |
| 2922 | (uintmax_t)flag_map_pos, |
| 2923 | (uintmax_t)ewah_bitmap_map_pos); |
| 2924 | }) |
| 2925 | ; |
| 2926 | |
| 2927 | free_bitmap_index(bitmap_git); |
| 2928 | |
| 2929 | return 0; |
| 2930 | } |
| 2931 | |
| 2932 | int test_bitmap_hashes(struct repository *r) |
| 2933 | { |
no test coverage detected