MCPcopy Index your code
hub / github.com/git/git / test_bitmap_commits_with_offset

Function test_bitmap_commits_with_offset

pack-bitmap.c:2890–2930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2888}
2889
2890int 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
2932int test_bitmap_hashes(struct repository *r)
2933{

Callers 1

Calls 6

prepare_bitmap_gitFunction · 0.85
load_bitmap_entries_v1Function · 0.85
printf_lnFunction · 0.85
oid_to_hexFunction · 0.85
free_bitmap_indexFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected