@@ -3855,7 +3855,7 @@ static void read_packs_list_from_stdin(struct rev_info *revs)
3855
3855
string_list_sort (& exclude_packs );
3856
3856
string_list_remove_duplicates (& exclude_packs , 0 );
3857
3857
3858
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
3858
+ packfile_store_for_each_pack ( packs , p ) {
3859
3859
const char * pack_name = pack_basename (p );
3860
3860
3861
3861
if ((item = string_list_lookup (& include_packs , pack_name )))
@@ -4106,7 +4106,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
4106
4106
* Re-mark only the fresh packs as kept so that objects in
4107
4107
* unknown packs do not halt the reachability traversal early.
4108
4108
*/
4109
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next )
4109
+ packfile_store_for_each_pack ( packs , p )
4110
4110
p -> pack_keep_in_core = 0 ;
4111
4111
mark_pack_kept_in_core (fresh_packs , 1 );
4112
4112
@@ -4144,7 +4144,7 @@ static void read_cruft_objects(void)
4144
4144
string_list_sort (& discard_packs );
4145
4145
string_list_sort (& fresh_packs );
4146
4146
4147
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
4147
+ packfile_store_for_each_pack ( packs , p ) {
4148
4148
const char * pack_name = pack_basename (p );
4149
4149
struct string_list_item * item ;
4150
4150
@@ -4397,7 +4397,7 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
4397
4397
struct packed_git * p ;
4398
4398
4399
4399
p = (last_found != (void * )1 ) ? last_found :
4400
- packfile_store_get_all_packs (packs );
4400
+ packfile_store_get_packs (packs );
4401
4401
4402
4402
while (p ) {
4403
4403
if ((!p -> pack_local || p -> pack_keep ||
@@ -4407,7 +4407,7 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
4407
4407
return 1 ;
4408
4408
}
4409
4409
if (p == last_found )
4410
- p = packfile_store_get_all_packs (packs );
4410
+ p = packfile_store_get_packs (packs );
4411
4411
else
4412
4412
p = p -> next ;
4413
4413
if (p == last_found )
@@ -4445,7 +4445,7 @@ static void loosen_unused_packed_objects(void)
4445
4445
uint32_t loosened_objects_nr = 0 ;
4446
4446
struct object_id oid ;
4447
4447
4448
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
4448
+ packfile_store_for_each_pack ( packs , p ) {
4449
4449
if (!p -> pack_local || p -> pack_keep || p -> pack_keep_in_core )
4450
4450
continue ;
4451
4451
@@ -4749,7 +4749,7 @@ static void add_extra_kept_packs(const struct string_list *names)
4749
4749
if (!names -> nr )
4750
4750
return ;
4751
4751
4752
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
4752
+ packfile_store_for_each_pack ( packs , p ) {
4753
4753
const char * name = basename (p -> pack_name );
4754
4754
int i ;
4755
4755
@@ -5190,7 +5190,7 @@ int cmd_pack_objects(int argc,
5190
5190
struct packfile_store * packs = the_repository -> objects -> packfiles ;
5191
5191
struct packed_git * p ;
5192
5192
5193
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next )
5193
+ packfile_store_for_each_pack ( packs , p )
5194
5194
if (p -> pack_local && p -> pack_keep )
5195
5195
break ;
5196
5196
if (!p ) /* no keep-able packs found */
@@ -5205,7 +5205,7 @@ int cmd_pack_objects(int argc,
5205
5205
struct packfile_store * packs = the_repository -> objects -> packfiles ;
5206
5206
struct packed_git * p ;
5207
5207
5208
- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
5208
+ packfile_store_for_each_pack ( packs , p ) {
5209
5209
if (!p -> pack_local ) {
5210
5210
have_non_local_packs = 1 ;
5211
5211
break ;
0 commit comments