@@ -1748,12 +1748,12 @@ static int want_object_in_pack_mtime(const struct object_id *oid,
1748
1748
}
1749
1749
}
1750
1750
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 )) {
1752
1752
struct packed_git * p = list_entry (pos , struct packed_git , mru );
1753
1753
want = want_object_in_pack_one (p , oid , exclude , found_pack , found_offset , found_mtime );
1754
1754
if (!exclude && want > 0 )
1755
1755
list_move (& p -> mru ,
1756
- get_packed_git_mru (the_repository ));
1756
+ packfile_store_get_packs_mru (the_repository -> objects -> packfiles ));
1757
1757
if (want != -1 )
1758
1758
return want ;
1759
1759
}
@@ -3831,6 +3831,7 @@ static int pack_mtime_cmp(const void *_a, const void *_b)
3831
3831
3832
3832
static void read_packs_list_from_stdin (struct rev_info * revs )
3833
3833
{
3834
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
3834
3835
struct strbuf buf = STRBUF_INIT ;
3835
3836
struct string_list include_packs = STRING_LIST_INIT_DUP ;
3836
3837
struct string_list exclude_packs = STRING_LIST_INIT_DUP ;
@@ -3855,7 +3856,7 @@ static void read_packs_list_from_stdin(struct rev_info *revs)
3855
3856
string_list_sort (& exclude_packs );
3856
3857
string_list_remove_duplicates (& exclude_packs , 0 );
3857
3858
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 ) {
3859
3860
const char * pack_name = pack_basename (p );
3860
3861
3861
3862
if ((item = string_list_lookup (& include_packs , pack_name )))
@@ -4076,6 +4077,7 @@ static void enumerate_cruft_objects(void)
4076
4077
4077
4078
static void enumerate_and_traverse_cruft_objects (struct string_list * fresh_packs )
4078
4079
{
4080
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
4079
4081
struct packed_git * p ;
4080
4082
struct rev_info revs ;
4081
4083
int ret ;
@@ -4105,7 +4107,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
4105
4107
* Re-mark only the fresh packs as kept so that objects in
4106
4108
* unknown packs do not halt the reachability traversal early.
4107
4109
*/
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 )
4109
4111
p -> pack_keep_in_core = 0 ;
4110
4112
mark_pack_kept_in_core (fresh_packs , 1 );
4111
4113
@@ -4122,6 +4124,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
4122
4124
4123
4125
static void read_cruft_objects (void )
4124
4126
{
4127
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
4125
4128
struct strbuf buf = STRBUF_INIT ;
4126
4129
struct string_list discard_packs = STRING_LIST_INIT_DUP ;
4127
4130
struct string_list fresh_packs = STRING_LIST_INIT_DUP ;
@@ -4142,7 +4145,7 @@ static void read_cruft_objects(void)
4142
4145
string_list_sort (& discard_packs );
4143
4146
string_list_sort (& fresh_packs );
4144
4147
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 ) {
4146
4149
const char * pack_name = pack_basename (p );
4147
4150
struct string_list_item * item ;
4148
4151
@@ -4390,11 +4393,12 @@ static void add_unreachable_loose_objects(struct rev_info *revs)
4390
4393
4391
4394
static int has_sha1_pack_kept_or_nonlocal (const struct object_id * oid )
4392
4395
{
4396
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
4393
4397
static struct packed_git * last_found = (void * )1 ;
4394
4398
struct packed_git * p ;
4395
4399
4396
4400
p = (last_found != (void * )1 ) ? last_found :
4397
- get_all_packs ( the_repository );
4401
+ packfile_store_get_all_packs ( packs );
4398
4402
4399
4403
while (p ) {
4400
4404
if ((!p -> pack_local || p -> pack_keep ||
@@ -4404,7 +4408,7 @@ static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
4404
4408
return 1 ;
4405
4409
}
4406
4410
if (p == last_found )
4407
- p = get_all_packs ( the_repository );
4411
+ p = packfile_store_get_all_packs ( packs );
4408
4412
else
4409
4413
p = p -> next ;
4410
4414
if (p == last_found )
@@ -4436,12 +4440,13 @@ static int loosened_object_can_be_discarded(const struct object_id *oid,
4436
4440
4437
4441
static void loosen_unused_packed_objects (void )
4438
4442
{
4443
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
4439
4444
struct packed_git * p ;
4440
4445
uint32_t i ;
4441
4446
uint32_t loosened_objects_nr = 0 ;
4442
4447
struct object_id oid ;
4443
4448
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 ) {
4445
4450
if (!p -> pack_local || p -> pack_keep || p -> pack_keep_in_core )
4446
4451
continue ;
4447
4452
@@ -4742,12 +4747,13 @@ static void get_object_list(struct rev_info *revs, struct strvec *argv)
4742
4747
4743
4748
static void add_extra_kept_packs (const struct string_list * names )
4744
4749
{
4750
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
4745
4751
struct packed_git * p ;
4746
4752
4747
4753
if (!names -> nr )
4748
4754
return ;
4749
4755
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 ) {
4751
4757
const char * name = basename (p -> pack_name );
4752
4758
int i ;
4753
4759
@@ -5185,8 +5191,10 @@ int cmd_pack_objects(int argc,
5185
5191
5186
5192
add_extra_kept_packs (& keep_pack_list );
5187
5193
if (ignore_packed_keep_on_disk ) {
5194
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
5188
5195
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 )
5190
5198
if (p -> pack_local && p -> pack_keep )
5191
5199
break ;
5192
5200
if (!p ) /* no keep-able packs found */
@@ -5198,8 +5206,10 @@ int cmd_pack_objects(int argc,
5198
5206
* want to unset "local" based on looking at packs, as
5199
5207
* it also covers non-local objects
5200
5208
*/
5209
+ struct packfile_store * packs = the_repository -> objects -> packfiles ;
5201
5210
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 ) {
5203
5213
if (!p -> pack_local ) {
5204
5214
have_non_local_packs = 1 ;
5205
5215
break ;
0 commit comments