@@ -190,13 +190,15 @@ static void set_island_marks(struct object *obj, struct island_bitmap *marks)
190
190
island_bitmap_or (b , marks );
191
191
}
192
192
193
- static void mark_remote_island_1 (struct remote_island * rl , int is_core_island )
193
+ static void mark_remote_island_1 (struct repository * r ,
194
+ struct remote_island * rl ,
195
+ int is_core_island )
194
196
{
195
197
uint32_t i ;
196
198
197
199
for (i = 0 ; i < rl -> oids .nr ; ++ i ) {
198
200
struct island_bitmap * marks ;
199
- struct object * obj = parse_object (the_repository , & rl -> oids .oid [i ]);
201
+ struct object * obj = parse_object (r , & rl -> oids .oid [i ]);
200
202
201
203
if (!obj )
202
204
continue ;
@@ -211,7 +213,7 @@ static void mark_remote_island_1(struct remote_island *rl, int is_core_island)
211
213
while (obj && obj -> type == OBJ_TAG ) {
212
214
obj = ((struct tag * )obj )-> tagged ;
213
215
if (obj ) {
214
- parse_object (the_repository , & obj -> oid );
216
+ parse_object (r , & obj -> oid );
215
217
marks = create_or_get_island_marks (obj );
216
218
island_bitmap_set (marks , island_counter );
217
219
}
@@ -237,7 +239,9 @@ static int tree_depth_compare(const void *a, const void *b)
237
239
return todo_a -> depth - todo_b -> depth ;
238
240
}
239
241
240
- void resolve_tree_islands (int progress , struct packing_data * to_pack )
242
+ void resolve_tree_islands (struct repository * r ,
243
+ int progress ,
244
+ struct packing_data * to_pack )
241
245
{
242
246
struct progress * progress_state = NULL ;
243
247
struct tree_islands_todo * todo ;
@@ -281,7 +285,7 @@ void resolve_tree_islands(int progress, struct packing_data *to_pack)
281
285
282
286
root_marks = kh_value (island_marks , pos );
283
287
284
- tree = lookup_tree (the_repository , & ent -> idx .oid );
288
+ tree = lookup_tree (r , & ent -> idx .oid );
285
289
if (!tree || parse_tree (tree ) < 0 )
286
290
die (_ ("bad tree object %s" ), oid_to_hex (& ent -> idx .oid ));
287
291
@@ -292,7 +296,7 @@ void resolve_tree_islands(int progress, struct packing_data *to_pack)
292
296
if (S_ISGITLINK (entry .mode ))
293
297
continue ;
294
298
295
- obj = lookup_object (the_repository , entry .oid -> hash );
299
+ obj = lookup_object (r , entry .oid -> hash );
296
300
if (!obj )
297
301
continue ;
298
302
@@ -415,7 +419,7 @@ static struct remote_island *get_core_island(void)
415
419
return NULL ;
416
420
}
417
421
418
- static void deduplicate_islands (void )
422
+ static void deduplicate_islands (struct repository * r )
419
423
{
420
424
struct remote_island * island , * core = NULL , * * list ;
421
425
unsigned int island_count , dst , src , ref , i = 0 ;
@@ -444,20 +448,20 @@ static void deduplicate_islands(void)
444
448
core = get_core_island ();
445
449
446
450
for (i = 0 ; i < island_count ; ++ i ) {
447
- mark_remote_island_1 (list [i ], core && list [i ]-> hash == core -> hash );
451
+ mark_remote_island_1 (r , list [i ], core && list [i ]-> hash == core -> hash );
448
452
}
449
453
450
454
free (list );
451
455
}
452
456
453
- void load_delta_islands (void )
457
+ void load_delta_islands (struct repository * r )
454
458
{
455
459
island_marks = kh_init_sha1 ();
456
460
remote_islands = kh_init_str ();
457
461
458
462
git_config (island_config_callback , NULL );
459
463
for_each_ref (find_island_for_ref , NULL );
460
- deduplicate_islands ();
464
+ deduplicate_islands (r );
461
465
462
466
fprintf (stderr , _ ("Marked %d islands, done.\n" ), island_counter );
463
467
}
0 commit comments