@@ -463,7 +463,7 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
463463 return 0 ;
464464}
465465
466- static int load_reverse_index (struct bitmap_index * bitmap_git )
466+ static int load_reverse_index (struct repository * r , struct bitmap_index * bitmap_git )
467467{
468468 if (bitmap_is_midx (bitmap_git )) {
469469 uint32_t i ;
@@ -477,23 +477,23 @@ static int load_reverse_index(struct bitmap_index *bitmap_git)
477477 * since we will need to make use of them in pack-objects.
478478 */
479479 for (i = 0 ; i < bitmap_git -> midx -> num_packs ; i ++ ) {
480- ret = load_pack_revindex (bitmap_git -> midx -> packs [i ]);
480+ ret = load_pack_revindex (r , bitmap_git -> midx -> packs [i ]);
481481 if (ret )
482482 return ret ;
483483 }
484484 return 0 ;
485485 }
486- return load_pack_revindex (bitmap_git -> pack );
486+ return load_pack_revindex (r , bitmap_git -> pack );
487487}
488488
489- static int load_bitmap (struct bitmap_index * bitmap_git )
489+ static int load_bitmap (struct repository * r , struct bitmap_index * bitmap_git )
490490{
491491 assert (bitmap_git -> map );
492492
493493 bitmap_git -> bitmaps = kh_init_oid_map ();
494494 bitmap_git -> ext_index .positions = kh_init_oid_pos ();
495495
496- if (load_reverse_index (bitmap_git ))
496+ if (load_reverse_index (r , bitmap_git ))
497497 goto failed ;
498498
499499 if (!(bitmap_git -> commits = read_bitmap_1 (bitmap_git )) ||
@@ -580,7 +580,7 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
580580{
581581 struct bitmap_index * bitmap_git = xcalloc (1 , sizeof (* bitmap_git ));
582582
583- if (!open_bitmap (r , bitmap_git ) && !load_bitmap (bitmap_git ))
583+ if (!open_bitmap (r , bitmap_git ) && !load_bitmap (r , bitmap_git ))
584584 return bitmap_git ;
585585
586586 free_bitmap_index (bitmap_git );
@@ -589,9 +589,10 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
589589
590590struct bitmap_index * prepare_midx_bitmap_git (struct multi_pack_index * midx )
591591{
592+ struct repository * r = the_repository ;
592593 struct bitmap_index * bitmap_git = xcalloc (1 , sizeof (* bitmap_git ));
593594
594- if (!open_midx_bitmap_1 (bitmap_git , midx ) && !load_bitmap (bitmap_git ))
595+ if (!open_midx_bitmap_1 (bitmap_git , midx ) && !load_bitmap (r , bitmap_git ))
595596 return bitmap_git ;
596597
597598 free_bitmap_index (bitmap_git );
@@ -1592,7 +1593,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
15921593 * from disk. this is the point of no return; after this the rev_list
15931594 * becomes invalidated and we must perform the revwalk through bitmaps
15941595 */
1595- if (load_bitmap (bitmap_git ) < 0 )
1596+ if (load_bitmap (revs -> repo , bitmap_git ) < 0 )
15961597 goto cleanup ;
15971598
15981599 object_array_clear (& revs -> pending );
@@ -1742,6 +1743,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
17421743 uint32_t * entries ,
17431744 struct bitmap * * reuse_out )
17441745{
1746+ struct repository * r = the_repository ;
17451747 struct packed_git * pack ;
17461748 struct bitmap * result = bitmap_git -> result ;
17471749 struct bitmap * reuse ;
@@ -1752,7 +1754,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
17521754
17531755 assert (result );
17541756
1755- load_reverse_index (bitmap_git );
1757+ load_reverse_index (r , bitmap_git );
17561758
17571759 if (bitmap_is_midx (bitmap_git ))
17581760 pack = bitmap_git -> midx -> packs [midx_preferred_pack (bitmap_git )];
@@ -2132,11 +2134,12 @@ int rebuild_bitmap(const uint32_t *reposition,
21322134uint32_t * create_bitmap_mapping (struct bitmap_index * bitmap_git ,
21332135 struct packing_data * mapping )
21342136{
2137+ struct repository * r = the_repository ;
21352138 uint32_t i , num_objects ;
21362139 uint32_t * reposition ;
21372140
21382141 if (!bitmap_is_midx (bitmap_git ))
2139- load_reverse_index (bitmap_git );
2142+ load_reverse_index (r , bitmap_git );
21402143 else if (load_midx_revindex (bitmap_git -> midx ) < 0 )
21412144 BUG ("rebuild_existing_bitmaps: missing required rev-cache "
21422145 "extension" );
0 commit comments