@@ -328,26 +328,27 @@ static int load_pack_bitmap(struct bitmap_index *bitmap_git)
328328 return -1 ;
329329}
330330
331- static int open_pack_bitmap (struct bitmap_index * bitmap_git )
331+ static int open_pack_bitmap (struct repository * r ,
332+ struct bitmap_index * bitmap_git )
332333{
333334 struct packed_git * p ;
334335 int ret = -1 ;
335336
336337 assert (!bitmap_git -> map );
337338
338- for (p = get_all_packs (the_repository ); p ; p = p -> next ) {
339+ for (p = get_all_packs (r ); p ; p = p -> next ) {
339340 if (open_pack_bitmap_1 (bitmap_git , p ) == 0 )
340341 ret = 0 ;
341342 }
342343
343344 return ret ;
344345}
345346
346- struct bitmap_index * prepare_bitmap_git (void )
347+ struct bitmap_index * prepare_bitmap_git (struct repository * r )
347348{
348349 struct bitmap_index * bitmap_git = xcalloc (1 , sizeof (* bitmap_git ));
349350
350- if (!open_pack_bitmap (bitmap_git ) && !load_pack_bitmap (bitmap_git ))
351+ if (!open_pack_bitmap (r , bitmap_git ) && !load_pack_bitmap (bitmap_git ))
351352 return bitmap_git ;
352353
353354 free_bitmap_index (bitmap_git );
@@ -690,7 +691,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs)
690691 struct bitmap_index * bitmap_git = xcalloc (1 , sizeof (* bitmap_git ));
691692 /* try to open a bitmapped pack, but don't parse it yet
692693 * because we may not need to use it */
693- if (open_pack_bitmap (bitmap_git ) < 0 )
694+ if (open_pack_bitmap (revs -> repo , bitmap_git ) < 0 )
694695 goto cleanup ;
695696
696697 for (i = 0 ; i < revs -> pending .nr ; ++ i ) {
@@ -955,7 +956,7 @@ void test_bitmap_walk(struct rev_info *revs)
955956 struct bitmap_test_data tdata ;
956957 struct bitmap_index * bitmap_git ;
957958
958- if (!(bitmap_git = prepare_bitmap_git ()))
959+ if (!(bitmap_git = prepare_bitmap_git (revs -> repo )))
959960 die ("failed to load bitmap indexes" );
960961
961962 if (revs -> pending .nr != 1 )
0 commit comments