@@ -1748,12 +1748,12 @@ static int want_object_in_pack_mtime(const struct object_id *oid,
17481748 }
17491749 }
17501750
1751- list_for_each (pos , get_packed_git_mru (the_repository )) {
1751+ list_for_each (pos , packfile_store_get_packs_mru (the_repository -> objects -> packfiles )) {
17521752 struct packed_git * p = list_entry (pos , struct packed_git , mru );
17531753 want = want_object_in_pack_one (p , oid , exclude , found_pack , found_offset , found_mtime );
17541754 if (!exclude && want > 0 )
17551755 list_move (& p -> mru ,
1756- get_packed_git_mru (the_repository ));
1756+ packfile_store_get_packs_mru (the_repository -> objects -> packfiles ));
17571757 if (want != -1 )
17581758 return want ;
17591759 }
@@ -3831,6 +3831,7 @@ static int pack_mtime_cmp(const void *_a, const void *_b)
38313831
38323832static void read_packs_list_from_stdin (struct rev_info * revs )
38333833{
3834+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
38343835 struct strbuf buf = STRBUF_INIT ;
38353836 struct string_list include_packs = STRING_LIST_INIT_DUP ;
38363837 struct string_list exclude_packs = STRING_LIST_INIT_DUP ;
@@ -3855,7 +3856,7 @@ static void read_packs_list_from_stdin(struct rev_info *revs)
38553856 string_list_sort (& exclude_packs );
38563857 string_list_remove_duplicates (& exclude_packs , 0 );
38573858
3858- for (p = get_all_packs ( the_repository ); p ; p = p -> next ) {
3859+ for (p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
38593860 const char * pack_name = pack_basename (p );
38603861
38613862 if ((item = string_list_lookup (& include_packs , pack_name )))
@@ -4076,6 +4077,7 @@ static void enumerate_cruft_objects(void)
40764077
40774078static void enumerate_and_traverse_cruft_objects (struct string_list * fresh_packs )
40784079{
4080+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
40794081 struct packed_git * p ;
40804082 struct rev_info revs ;
40814083 int ret ;
@@ -4105,7 +4107,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
41054107 * Re-mark only the fresh packs as kept so that objects in
41064108 * unknown packs do not halt the reachability traversal early.
41074109 */
4108- for (p = get_all_packs ( the_repository ); p ; p = p -> next )
4110+ for (p = packfile_store_get_all_packs ( packs ); p ; p = p -> next )
41094111 p -> pack_keep_in_core = 0 ;
41104112 mark_pack_kept_in_core (fresh_packs , 1 );
41114113
@@ -4122,6 +4124,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
41224124
41234125static void read_cruft_objects (void )
41244126{
4127+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
41254128 struct strbuf buf = STRBUF_INIT ;
41264129 struct string_list discard_packs = STRING_LIST_INIT_DUP ;
41274130 struct string_list fresh_packs = STRING_LIST_INIT_DUP ;
@@ -4142,7 +4145,7 @@ static void read_cruft_objects(void)
41424145 string_list_sort (& discard_packs );
41434146 string_list_sort (& fresh_packs );
41444147
4145- for (p = get_all_packs ( the_repository ); p ; p = p -> next ) {
4148+ for (p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
41464149 const char * pack_name = pack_basename (p );
41474150 struct string_list_item * item ;
41484151
@@ -4390,11 +4393,12 @@ static void add_unreachable_loose_objects(struct rev_info *revs)
43904393
43914394static int has_sha1_pack_kept_or_nonlocal (const struct object_id * oid )
43924395{
4396+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
43934397 static struct packed_git * last_found = (void * )1 ;
43944398 struct packed_git * p ;
43954399
43964400 p = (last_found != (void * )1 ) ? last_found :
4397- get_all_packs ( the_repository );
4401+ packfile_store_get_all_packs ( packs );
43984402
43994403 while (p ) {
44004404 if ((!p -> pack_local || p -> pack_keep ||
@@ -4404,7 +4408,7 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
44044408 return 1 ;
44054409 }
44064410 if (p == last_found )
4407- p = get_all_packs ( the_repository );
4411+ p = packfile_store_get_all_packs ( packs );
44084412 else
44094413 p = p -> next ;
44104414 if (p == last_found )
@@ -4436,12 +4440,13 @@ static int loosened_object_can_be_discarded(const struct object_id *oid,
44364440
44374441static void loosen_unused_packed_objects (void )
44384442{
4443+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
44394444 struct packed_git * p ;
44404445 uint32_t i ;
44414446 uint32_t loosened_objects_nr = 0 ;
44424447 struct object_id oid ;
44434448
4444- for (p = get_all_packs ( the_repository ); p ; p = p -> next ) {
4449+ for (p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
44454450 if (!p -> pack_local || p -> pack_keep || p -> pack_keep_in_core )
44464451 continue ;
44474452
@@ -4742,12 +4747,13 @@ static void get_object_list(struct rev_info *revs, struct strvec *argv)
47424747
47434748static void add_extra_kept_packs (const struct string_list * names )
47444749{
4750+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
47454751 struct packed_git * p ;
47464752
47474753 if (!names -> nr )
47484754 return ;
47494755
4750- for (p = get_all_packs ( the_repository ); p ; p = p -> next ) {
4756+ for (p = packfile_store_get_all_packs ( packs ); p ; p = p -> next ) {
47514757 const char * name = basename (p -> pack_name );
47524758 int i ;
47534759
@@ -5185,8 +5191,10 @@ int cmd_pack_objects(int argc,
51855191
51865192 add_extra_kept_packs (& keep_pack_list );
51875193 if (ignore_packed_keep_on_disk ) {
5194+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
51885195 struct packed_git * p ;
5189- for (p = get_all_packs (the_repository ); p ; p = p -> next )
5196+
5197+ for (p = packfile_store_get_all_packs (packs ); p ; p = p -> next )
51905198 if (p -> pack_local && p -> pack_keep )
51915199 break ;
51925200 if (!p ) /* no keep-able packs found */
@@ -5198,8 +5206,10 @@ int cmd_pack_objects(int argc,
51985206 * want to unset "local" based on looking at packs, as
51995207 * it also covers non-local objects
52005208 */
5209+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
52015210 struct packed_git * p ;
5202- for (p = get_all_packs (the_repository ); p ; p = p -> next ) {
5211+
5212+ for (p = packfile_store_get_all_packs (packs ); p ; p = p -> next ) {
52035213 if (!p -> pack_local ) {
52045214 have_non_local_packs = 1 ;
52055215 break ;
0 commit comments