@@ -3855,7 +3855,7 @@ static void read_packs_list_from_stdin(struct rev_info *revs)
38553855 string_list_sort (& exclude_packs );
38563856 string_list_remove_duplicates (& exclude_packs , 0 );
38573857
3858- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
3858+ packfile_store_for_each_pack ( packs , p ) {
38593859 const char * pack_name = pack_basename (p );
38603860
38613861 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
41064106 * Re-mark only the fresh packs as kept so that objects in
41074107 * unknown packs do not halt the reachability traversal early.
41084108 */
4109- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next )
4109+ packfile_store_for_each_pack ( packs , p )
41104110 p -> pack_keep_in_core = 0 ;
41114111 mark_pack_kept_in_core (fresh_packs , 1 );
41124112
@@ -4144,7 +4144,7 @@ static void read_cruft_objects(void)
41444144 string_list_sort (& discard_packs );
41454145 string_list_sort (& fresh_packs );
41464146
4147- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
4147+ packfile_store_for_each_pack ( packs , p ) {
41484148 const char * pack_name = pack_basename (p );
41494149 struct string_list_item * item ;
41504150
@@ -4397,7 +4397,7 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
43974397 struct packed_git * p ;
43984398
43994399 p = (last_found != (void * )1 ) ? last_found :
4400- packfile_store_get_all_packs (packs );
4400+ packfile_store_get_packs (packs );
44014401
44024402 while (p ) {
44034403 if ((!p -> pack_local || p -> pack_keep ||
@@ -4407,7 +4407,7 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
44074407 return 1 ;
44084408 }
44094409 if (p == last_found )
4410- p = packfile_store_get_all_packs (packs );
4410+ p = packfile_store_get_packs (packs );
44114411 else
44124412 p = p -> next ;
44134413 if (p == last_found )
@@ -4445,7 +4445,7 @@ static void loosen_unused_packed_objects(void)
44454445 uint32_t loosened_objects_nr = 0 ;
44464446 struct object_id oid ;
44474447
4448- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
4448+ packfile_store_for_each_pack ( packs , p ) {
44494449 if (!p -> pack_local || p -> pack_keep || p -> pack_keep_in_core )
44504450 continue ;
44514451
@@ -4749,7 +4749,7 @@ static void add_extra_kept_packs(const struct string_list *names)
47494749 if (!names -> nr )
47504750 return ;
47514751
4752- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
4752+ packfile_store_for_each_pack ( packs , p ) {
47534753 const char * name = basename (p -> pack_name );
47544754 int i ;
47554755
@@ -5190,7 +5190,7 @@ int cmd_pack_objects(int argc,
51905190 struct packfile_store * packs = the_repository -> objects -> packfiles ;
51915191 struct packed_git * p ;
51925192
5193- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next )
5193+ packfile_store_for_each_pack ( packs , p )
51945194 if (p -> pack_local && p -> pack_keep )
51955195 break ;
51965196 if (!p ) /* no keep-able packs found */
@@ -5205,7 +5205,7 @@ int cmd_pack_objects(int argc,
52055205 struct packfile_store * packs = the_repository -> objects -> packfiles ;
52065206 struct packed_git * p ;
52075207
5208- for ( p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
5208+ packfile_store_for_each_pack ( packs , p ) {
52095209 if (!p -> pack_local ) {
52105210 have_non_local_packs = 1 ;
52115211 break ;
0 commit comments