@@ -465,7 +465,7 @@ static int open_pack_bitmap_1(struct bitmap_index *bitmap_git, struct packed_git
465465 return 0 ;
466466}
467467
468- static int load_reverse_index (struct bitmap_index * bitmap_git )
468+ static int load_reverse_index (struct repository * r , struct bitmap_index * bitmap_git )
469469{
470470 if (bitmap_is_midx (bitmap_git )) {
471471 uint32_t i ;
@@ -479,23 +479,23 @@ static int load_reverse_index(struct bitmap_index *bitmap_git)
479479 * since we will need to make use of them in pack-objects.
480480 */
481481 for (i = 0 ; i < bitmap_git -> midx -> num_packs ; i ++ ) {
482- ret = load_pack_revindex (bitmap_git -> midx -> packs [i ]);
482+ ret = load_pack_revindex (r , bitmap_git -> midx -> packs [i ]);
483483 if (ret )
484484 return ret ;
485485 }
486486 return 0 ;
487487 }
488- return load_pack_revindex (bitmap_git -> pack );
488+ return load_pack_revindex (r , bitmap_git -> pack );
489489}
490490
491- static int load_bitmap (struct bitmap_index * bitmap_git )
491+ static int load_bitmap (struct repository * r , struct bitmap_index * bitmap_git )
492492{
493493 assert (bitmap_git -> map );
494494
495495 bitmap_git -> bitmaps = kh_init_oid_map ();
496496 bitmap_git -> ext_index .positions = kh_init_oid_pos ();
497497
498- if (load_reverse_index (bitmap_git ))
498+ if (load_reverse_index (r , bitmap_git ))
499499 goto failed ;
500500
501501 if (!(bitmap_git -> commits = read_bitmap_1 (bitmap_git )) ||
@@ -582,7 +582,7 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
582582{
583583 struct bitmap_index * bitmap_git = xcalloc (1 , sizeof (* bitmap_git ));
584584
585- if (!open_bitmap (r , bitmap_git ) && !load_bitmap (bitmap_git ))
585+ if (!open_bitmap (r , bitmap_git ) && !load_bitmap (r , bitmap_git ))
586586 return bitmap_git ;
587587
588588 free_bitmap_index (bitmap_git );
@@ -591,9 +591,10 @@ struct bitmap_index *prepare_bitmap_git(struct repository *r)
591591
592592struct bitmap_index * prepare_midx_bitmap_git (struct multi_pack_index * midx )
593593{
594+ struct repository * r = the_repository ;
594595 struct bitmap_index * bitmap_git = xcalloc (1 , sizeof (* bitmap_git ));
595596
596- if (!open_midx_bitmap_1 (bitmap_git , midx ) && !load_bitmap (bitmap_git ))
597+ if (!open_midx_bitmap_1 (bitmap_git , midx ) && !load_bitmap (r , bitmap_git ))
597598 return bitmap_git ;
598599
599600 free_bitmap_index (bitmap_git );
@@ -1594,7 +1595,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
15941595 * from disk. this is the point of no return; after this the rev_list
15951596 * becomes invalidated and we must perform the revwalk through bitmaps
15961597 */
1597- if (load_bitmap (bitmap_git ) < 0 )
1598+ if (load_bitmap (revs -> repo , bitmap_git ) < 0 )
15981599 goto cleanup ;
15991600
16001601 object_array_clear (& revs -> pending );
@@ -1744,6 +1745,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
17441745 uint32_t * entries ,
17451746 struct bitmap * * reuse_out )
17461747{
1748+ struct repository * r = the_repository ;
17471749 struct packed_git * pack ;
17481750 struct bitmap * result = bitmap_git -> result ;
17491751 struct bitmap * reuse ;
@@ -1754,7 +1756,7 @@ int reuse_partial_packfile_from_bitmap(struct bitmap_index *bitmap_git,
17541756
17551757 assert (result );
17561758
1757- load_reverse_index (bitmap_git );
1759+ load_reverse_index (r , bitmap_git );
17581760
17591761 if (bitmap_is_midx (bitmap_git ))
17601762 pack = bitmap_git -> midx -> packs [midx_preferred_pack (bitmap_git )];
@@ -2134,11 +2136,12 @@ int rebuild_bitmap(const uint32_t *reposition,
21342136uint32_t * create_bitmap_mapping (struct bitmap_index * bitmap_git ,
21352137 struct packing_data * mapping )
21362138{
2139+ struct repository * r = the_repository ;
21372140 uint32_t i , num_objects ;
21382141 uint32_t * reposition ;
21392142
21402143 if (!bitmap_is_midx (bitmap_git ))
2141- load_reverse_index (bitmap_git );
2144+ load_reverse_index (r , bitmap_git );
21422145 else if (load_midx_revindex (bitmap_git -> midx ) < 0 )
21432146 BUG ("rebuild_existing_bitmaps: missing required rev-cache "
21442147 "extension" );
0 commit comments