packfile: refactor `get_all_packs()` to work on packfile store
The `get_all_packs()` function prepares the packfile store and then returns its packfiles. Refactor it to accept a packfile store instead of a repository to clarify its scope. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Sep 23, 2025 at 12:17 UTC
d2779beb36ff64eb062103db14006f7ae6da5f37
18 files changed
+76
-42
builtin/cat-file.c
+2
-1
@@ -852,9 +852,10 @@ static void batch_each_object(struct batch_options *opt,
852
853
if (bitmap && !for_each_bitmapped_object(bitmap, &opt->objects_filter,
854
batch_one_object_bitmapped, &payload)) {
855
+ struct packfile_store *packs = the_repository->objects->packfiles;
856
struct packed_git *pack;
857
857
- for (pack = get_all_packs(the_repository); pack; pack = pack->next) {
858
+ for (pack = packfile_store_get_all_packs(packs); pack; pack = pack->next) {
859
if (bitmap_index_contains_pack(bitmap, pack) ||
860
open_pack_index(pack))
861
continue;
builtin/count-objects.c
+2
-1
@@ -122,6 +122,7 @@ int cmd_count_objects(int argc,
122
count_loose, count_cruft, NULL, NULL);
123
124
if (verbose) {
125
+ struct packfile_store *packs = the_repository->objects->packfiles;
126
struct packed_git *p;
127
unsigned long num_pack = 0;
128
off_t size_pack = 0;
@@ -129,7 +130,7 @@ int cmd_count_objects(int argc,
130
struct strbuf pack_buf = STRBUF_INIT;
131
struct strbuf garbage_buf = STRBUF_INIT;
132
132
- for (p = get_all_packs(the_repository); p; p = p->next) {
133
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
134
if (!p->pack_local)
135
continue;
136
if (open_pack_index(p))
builtin/fast-import.c
+4
-2
@@ -952,6 +952,7 @@ static int store_object(
952
struct object_id *oidout,
953
uintmax_t mark)
954
{
955
+ struct packfile_store *packs = the_repository->objects->packfiles;
956
void *out, *delta;
957
struct object_entry *e;
958
unsigned char hdr[96];
@@ -975,7 +976,7 @@ static int store_object(
976
if (e->idx.offset) {
977
duplicate_count_by_type[type]++;
978
return 1;
978
- } else if (find_oid_pack(&oid, get_all_packs(the_repository))) {
979
+ } else if (find_oid_pack(&oid, packfile_store_get_all_packs(packs))) {
980
e->type = type;
981
e->pack_id = MAX_PACK_ID;
982
e->idx.offset = 1; /* just not zero! */
@@ -1092,6 +1093,7 @@ static void truncate_pack(struct hashfile_checkpoint *checkpoint)
1093
1094
static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
1095
{
1096
+ struct packfile_store *packs = the_repository->objects->packfiles;
1097
size_t in_sz = 64 * 1024, out_sz = 64 * 1024;
1098
unsigned char *in_buf = xmalloc(in_sz);
1099
unsigned char *out_buf = xmalloc(out_sz);
@@ -1175,7 +1177,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
1177
duplicate_count_by_type[OBJ_BLOB]++;
1178
truncate_pack(&checkpoint);
1179
1178
- } else if (find_oid_pack(&oid, get_all_packs(the_repository))) {
1180
+ } else if (find_oid_pack(&oid, packfile_store_get_all_packs(packs))) {
1181
e->type = OBJ_BLOB;
1182
e->pack_id = MAX_PACK_ID;
1183
e->idx.offset = 1; /* just not zero! */
builtin/fsck.c
+7
-4
@@ -867,19 +867,20 @@ static int mark_packed_for_connectivity(const struct object_id *oid,
867
868
static int check_pack_rev_indexes(struct repository *r, int show_progress)
869
{
870
+ struct packfile_store *packs = r->objects->packfiles;
871
struct progress *progress = NULL;
872
uint32_t pack_count = 0;
873
int res = 0;
874
875
if (show_progress) {
875
- for (struct packed_git *p = get_all_packs(r); p; p = p->next)
876
+ for (struct packed_git *p = packfile_store_get_all_packs(packs); p; p = p->next)
877
pack_count++;
878
progress = start_delayed_progress(the_repository,
879
"Verifying reverse pack-indexes", pack_count);
880
pack_count = 0;
881
}
882
882
- for (struct packed_git *p = get_all_packs(r); p; p = p->next) {
883
+ for (struct packed_git *p = packfile_store_get_all_packs(packs); p; p = p->next) {
884
int load_error = load_pack_revindex_from_disk(p);
885
886
if (load_error < 0) {
@@ -999,6 +1000,8 @@ int cmd_fsck(int argc,
1000
for_each_packed_object(the_repository,
1001
mark_packed_for_connectivity, NULL, 0);
1002
} else {
1003
+ struct packfile_store *packs = the_repository->objects->packfiles;
1004
+
1005
odb_prepare_alternates(the_repository->objects);
1006
for (source = the_repository->objects->sources; source; source = source->next)
1007
fsck_source(source);
@@ -1009,7 +1012,7 @@ int cmd_fsck(int argc,
1012
struct progress *progress = NULL;
1013
1014
if (show_progress) {
1012
- for (p = get_all_packs(the_repository); p;
1015
+ for (p = packfile_store_get_all_packs(packs); p;
1016
p = p->next) {
1017
if (open_pack_index(p))
1018
continue;
@@ -1019,7 +1022,7 @@ int cmd_fsck(int argc,
1022
progress = start_progress(the_repository,
1023
_("Checking objects"), total);
1024
}
1022
- for (p = get_all_packs(the_repository); p;
1025
+ for (p = packfile_store_get_all_packs(packs); p;
1026
p = p->next) {
1027
/* verify gives error messages itself */
1028
if (verify_pack(the_repository,
builtin/gc.c
+5
-3
@@ -487,9 +487,10 @@ static int too_many_loose_objects(struct gc_config *cfg)
487
static struct packed_git *find_base_packs(struct string_list *packs,
488
unsigned long limit)
489
{
490
+ struct packfile_store *packfiles = the_repository->objects->packfiles;
491
struct packed_git *p, *base = NULL;
492
492
- for (p = get_all_packs(the_repository); p; p = p->next) {
493
+ for (p = packfile_store_get_all_packs(packfiles); p; p = p->next) {
494
if (!p->pack_local || p->is_cruft)
495
continue;
496
if (limit) {
@@ -508,13 +509,14 @@ static struct packed_git *find_base_packs(struct string_list *packs,
509
510
static int too_many_packs(struct gc_config *cfg)
511
{
512
+ struct packfile_store *packs = the_repository->objects->packfiles;
513
struct packed_git *p;
514
int cnt;
515
516
if (cfg->gc_auto_pack_limit <= 0)
517
return 0;
518
517
- for (cnt = 0, p = get_all_packs(the_repository); p; p = p->next) {
519
+ for (cnt = 0, p = packfile_store_get_all_packs(packs); p; p = p->next) {
520
if (!p->pack_local)
521
continue;
522
if (p->pack_keep)
@@ -1492,7 +1494,7 @@ static off_t get_auto_pack_size(void)
1494
struct repository *r = the_repository;
1495
1496
odb_reprepare(r->objects);
1495
- for (p = get_all_packs(r); p; p = p->next) {
1497
+ for (p = packfile_store_get_all_packs(r->objects->packfiles); p; p = p->next) {
1498
if (p->pack_size > max_size) {
1499
second_largest_size = max_size;
1500
max_size = p->pack_size;
builtin/pack-objects.c
+19
-9
@@ -3831,6 +3831,7 @@ static int pack_mtime_cmp(const void *_a, const void *_b)
3831
3832
static void read_packs_list_from_stdin(struct rev_info *revs)
3833
{
3834
+ struct packfile_store *packs = the_repository->objects->packfiles;
3835
struct strbuf buf = STRBUF_INIT;
3836
struct string_list include_packs = STRING_LIST_INIT_DUP;
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)
3856
string_list_sort(&exclude_packs);
3857
string_list_remove_duplicates(&exclude_packs, 0);
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) {
3860
const char *pack_name = pack_basename(p);
3861
3862
if ((item = string_list_lookup(&include_packs, pack_name)))
@@ -4076,6 +4077,7 @@ static void enumerate_cruft_objects(void)
4077
4078
static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs)
4079
{
4080
+ struct packfile_store *packs = the_repository->objects->packfiles;
4081
struct packed_git *p;
4082
struct rev_info revs;
4083
int ret;
@@ -4105,7 +4107,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
4107
* Re-mark only the fresh packs as kept so that objects in
4108
* unknown packs do not halt the reachability traversal early.
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)
4111
p->pack_keep_in_core = 0;
4112
mark_pack_kept_in_core(fresh_packs, 1);
4113
@@ -4122,6 +4124,7 @@ static void enumerate_and_traverse_cruft_objects(struct string_list *fresh_packs
4124
4125
static void read_cruft_objects(void)
4126
{
4127
+ struct packfile_store *packs = the_repository->objects->packfiles;
4128
struct strbuf buf = STRBUF_INIT;
4129
struct string_list discard_packs = STRING_LIST_INIT_DUP;
4130
struct string_list fresh_packs = STRING_LIST_INIT_DUP;
@@ -4142,7 +4145,7 @@ static void read_cruft_objects(void)
4145
string_list_sort(&discard_packs);
4146
string_list_sort(&fresh_packs);
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) {
4149
const char *pack_name = pack_basename(p);
4150
struct string_list_item *item;
4151
@@ -4390,11 +4393,12 @@ static void add_unreachable_loose_objects(struct rev_info *revs)
4393
4394
static int has_sha1_pack_kept_or_nonlocal(const struct object_id *oid)
4395
{
4396
+ struct packfile_store *packs = the_repository->objects->packfiles;
4397
static struct packed_git *last_found = (void *)1;
4398
struct packed_git *p;
4399
4400
p = (last_found != (void *)1) ? last_found :
4397
- get_all_packs(the_repository);
4401
+ packfile_store_get_all_packs(packs);
4402
4403
while (p) {
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)
4408
return 1;
4409
}
4410
if (p == last_found)
4407
- p = get_all_packs(the_repository);
4411
+ p = packfile_store_get_all_packs(packs);
4412
else
4413
p = p->next;
4414
if (p == last_found)
@@ -4436,12 +4440,13 @@ static int loosened_object_can_be_discarded(const struct object_id *oid,
4440
4441
static void loosen_unused_packed_objects(void)
4442
{
4443
+ struct packfile_store *packs = the_repository->objects->packfiles;
4444
struct packed_git *p;
4445
uint32_t i;
4446
uint32_t loosened_objects_nr = 0;
4447
struct object_id oid;
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) {
4450
if (!p->pack_local || p->pack_keep || p->pack_keep_in_core)
4451
continue;
4452
@@ -4742,12 +4747,13 @@ static void get_object_list(struct rev_info *revs, int ac, const char **av)
4747
4748
static void add_extra_kept_packs(const struct string_list *names)
4749
{
4750
+ struct packfile_store *packs = the_repository->objects->packfiles;
4751
struct packed_git *p;
4752
4753
if (!names->nr)
4754
return;
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) {
4757
const char *name = basename(p->pack_name);
4758
int i;
4759
@@ -5185,8 +5191,10 @@ int cmd_pack_objects(int argc,
5191
5192
add_extra_kept_packs(&keep_pack_list);
5193
if (ignore_packed_keep_on_disk) {
5194
+ struct packfile_store *packs = the_repository->objects->packfiles;
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)
5198
if (p->pack_local && p->pack_keep)
5199
break;
5200
if (!p) /* no keep-able packs found */
@@ -5198,8 +5206,10 @@ int cmd_pack_objects(int argc,
5206
* want to unset "local" based on looking at packs, as
5207
* it also covers non-local objects
5208
*/
5209
+ struct packfile_store *packs = the_repository->objects->packfiles;
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) {
5213
if (!p->pack_local) {
5214
have_non_local_packs = 1;
5215
break;
builtin/pack-redundant.c
+4
-2
@@ -566,7 +566,8 @@ static struct pack_list * add_pack(struct packed_git *p)
566
567
static struct pack_list * add_pack_file(const char *filename)
568
{
569
- struct packed_git *p = get_all_packs(the_repository);
569
+ struct packfile_store *packs = the_repository->objects->packfiles;
570
+ struct packed_git *p = packfile_store_get_all_packs(packs);
571
572
if (strlen(filename) < 40)
573
die("Bad pack filename: %s", filename);
@@ -581,7 +582,8 @@ static struct pack_list * add_pack_file(const char *filename)
582
583
static void load_all(void)
584
{
584
- struct packed_git *p = get_all_packs(the_repository);
585
+ struct packfile_store *packs = the_repository->objects->packfiles;
586
+ struct packed_git *p = packfile_store_get_all_packs(packs);
587
588
while (p) {
589
add_pack(p);
builtin/repack.c
+6
-3
@@ -265,10 +265,11 @@ static void existing_packs_release(struct existing_packs *existing)
265
static void collect_pack_filenames(struct existing_packs *existing,
266
const struct string_list *extra_keep)
267
{
268
+ struct packfile_store *packs = the_repository->objects->packfiles;
269
struct packed_git *p;
270
struct strbuf buf = STRBUF_INIT;
271
271
- for (p = get_all_packs(the_repository); p; p = p->next) {
272
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
273
int i;
274
const char *base;
275
@@ -497,10 +498,11 @@ static void init_pack_geometry(struct pack_geometry *geometry,
498
struct existing_packs *existing,
499
const struct pack_objects_args *args)
500
{
501
+ struct packfile_store *packs = the_repository->objects->packfiles;
502
struct packed_git *p;
503
struct strbuf buf = STRBUF_INIT;
504
503
- for (p = get_all_packs(the_repository); p; p = p->next) {
505
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
506
if (args->local && !p->pack_local)
507
/*
508
* When asked to only repack local packfiles we skip
@@ -1137,11 +1139,12 @@ static int write_filtered_pack(const struct pack_objects_args *args,
1139
static void combine_small_cruft_packs(FILE *in, size_t combine_cruft_below_size,
1140
struct existing_packs *existing)
1141
{
1142
+ struct packfile_store *packs = the_repository->objects->packfiles;
1143
struct packed_git *p;
1144
struct strbuf buf = STRBUF_INIT;
1145
size_t i;
1146
1144
- for (p = get_all_packs(the_repository); p; p = p->next) {
1147
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
1148
if (!(p->is_cruft && p->pack_local))
1149
continue;
1150
connected.c
+2
-1
@@ -74,9 +74,10 @@ int check_connected(oid_iterate_fn fn, void *cb_data,
74
*/
75
odb_reprepare(the_repository->objects);
76
do {
77
+ struct packfile_store *packs = the_repository->objects->packfiles;
78
struct packed_git *p;
79
79
- for (p = get_all_packs(the_repository); p; p = p->next) {
80
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
81
if (!p->pack_promisor)
82
continue;
83
if (find_pack_entry_one(oid, p))
http-backend.c
+3
-2
@@ -603,18 +603,19 @@ static void get_head(struct strbuf *hdr, char *arg UNUSED)
603
static void get_info_packs(struct strbuf *hdr, char *arg UNUSED)
604
{
605
size_t objdirlen = strlen(repo_get_object_directory(the_repository));
606
+ struct packfile_store *packs = the_repository->objects->packfiles;
607
struct strbuf buf = STRBUF_INIT;
608
struct packed_git *p;
609
size_t cnt = 0;
610
611
select_getanyfile(hdr);
611
- for (p = get_all_packs(the_repository); p; p = p->next) {
612
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
613
if (p->pack_local)
614
cnt++;
615
}
616
617
strbuf_grow(&buf, cnt * 53 + 2);
617
- for (p = get_all_packs(the_repository); p; p = p->next) {
618
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
619
if (p->pack_local)
620
strbuf_addf(&buf, "P %s\n", p->pack_name + objdirlen + 6);
621
}
http.c
+2
-1
@@ -2408,6 +2408,7 @@ static char *fetch_pack_index(unsigned char *hash, const char *base_url)
2408
static int fetch_and_setup_pack_index(struct packed_git **packs_head,
2409
unsigned char *sha1, const char *base_url)
2410
{
2411
+ struct packfile_store *packs = the_repository->objects->packfiles;
2412
struct packed_git *new_pack, *p;
2413
char *tmp_idx = NULL;
2414
int ret;
@@ -2416,7 +2417,7 @@ static int fetch_and_setup_pack_index(struct packed_git **packs_head,
2417
* If we already have the pack locally, no need to fetch its index or
2418
* even add it to list; we already have all of its objects.
2419
*/
2419
- for (p = get_all_packs(the_repository); p; p = p->next) {
2420
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
2421
if (hasheq(p->hash, sha1, the_repository->hash_algo))
2422
return 0;
2423
}
pack-bitmap.c
+2
-2
@@ -664,7 +664,7 @@ static int open_pack_bitmap(struct repository *r,
664
struct packed_git *p;
665
int ret = -1;
666
667
- for (p = get_all_packs(r); p; p = p->next) {
667
+ for (p = packfile_store_get_all_packs(r->objects->packfiles); p; p = p->next) {
668
if (open_pack_bitmap_1(bitmap_git, p) == 0) {
669
ret = 0;
670
/*
@@ -3362,7 +3362,7 @@ int verify_bitmap_files(struct repository *r)
3362
free(midx_bitmap_name);
3363
}
3364
3365
- for (struct packed_git *p = get_all_packs(r);
3365
+ for (struct packed_git *p = packfile_store_get_all_packs(r->objects->packfiles);
3366
p; p = p->next) {
3367
char *pack_bitmap_name = pack_bitmap_filename(p);
3368
res |= verify_bitmap_file(r->hash_algo, pack_bitmap_name);
pack-objects.c
+2
-1
@@ -86,6 +86,7 @@ struct object_entry *packlist_find(struct packing_data *pdata,
86
87
static void prepare_in_pack_by_idx(struct packing_data *pdata)
88
{
89
+ struct packfile_store *packs = pdata->repo->objects->packfiles;
90
struct packed_git **mapping, *p;
91
int cnt = 0, nr = 1U << OE_IN_PACK_BITS;
92
@@ -95,7 +96,7 @@ static void prepare_in_pack_by_idx(struct packing_data *pdata)
96
* (i.e. in_pack_idx also zero) should return NULL.
97
*/
98
mapping[cnt++] = NULL;
98
- for (p = get_all_packs(pdata->repo); p; p = p->next, cnt++) {
99
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next, cnt++) {
100
if (cnt == nr) {
101
free(mapping);
102
return;
packfile.c
+6
-6
@@ -1033,11 +1033,11 @@ struct packed_git *packfile_store_get_packs(struct packfile_store *store)
1033
return store->packs;
1034
}
1035
1036
-struct packed_git *get_all_packs(struct repository *r)
1036
+struct packed_git *packfile_store_get_all_packs(struct packfile_store *store)
1037
{
1038
- packfile_store_prepare(r->objects->packfiles);
1038
+ packfile_store_prepare(store);
1039
1040
- for (struct odb_source *source = r->objects->sources; source; source = source->next) {
1040
+ for (struct odb_source *source = store->odb->sources; source; source = source->next) {
1041
struct multi_pack_index *m = source->midx;
1042
if (!m)
1043
continue;
@@ -1045,7 +1045,7 @@ struct packed_git *get_all_packs(struct repository *r)
1045
prepare_midx_pack(m, i);
1046
}
1047
1048
- return r->objects->packfiles->packs;
1048
+ return store->packs;
1049
}
1050
1051
struct list_head *get_packed_git_mru(struct repository *r)
@@ -2105,7 +2105,7 @@ struct packed_git **kept_pack_cache(struct repository *r, unsigned flags)
2105
* covers, one kept and one not kept, but the midx returns only
2106
* the non-kept version.
2107
*/
2108
- for (p = get_all_packs(r); p; p = p->next) {
2108
+ for (p = packfile_store_get_all_packs(r->objects->packfiles); p; p = p->next) {
2109
if ((p->pack_keep && (flags & ON_DISK_KEEP_PACKS)) ||
2110
(p->pack_keep_in_core && (flags & IN_CORE_KEEP_PACKS))) {
2111
ALLOC_GROW(packs, nr + 1, alloc);
@@ -2202,7 +2202,7 @@ int for_each_packed_object(struct repository *repo, each_packed_object_fn cb,
2202
int r = 0;
2203
int pack_errors = 0;
2204
2205
- for (p = get_all_packs(repo); p; p = p->next) {
2205
+ for (p = packfile_store_get_all_packs(repo->objects->packfiles); p; p = p->next) {
2206
if ((flags & FOR_EACH_OBJECT_LOCAL_ONLY) && !p->pack_local)
2207
continue;
2208
if ((flags & FOR_EACH_OBJECT_PROMISOR_ONLY) &&
packfile.h
+6
-1
@@ -142,6 +142,12 @@ void packfile_store_add_pack(struct packfile_store *store,
142
*/
143
struct packed_git *packfile_store_get_packs(struct packfile_store *store);
144
145
+/*
146
+ * Get all packs managed by the given store, including packfiles that are
147
+ * referenced by multi-pack indices.
148
+ */
149
+struct packed_git *packfile_store_get_all_packs(struct packfile_store *store);
150
+
151
/*
152
* Open the packfile and add it to the store if it isn't yet known. Returns
153
* either the newly opened packfile or the preexisting packfile. Returns a
@@ -227,7 +233,6 @@ int for_each_packed_object(struct repository *repo, each_packed_object_fn cb,
233
extern void (*report_garbage)(unsigned seen_bits, const char *path);
234
235
struct list_head *get_packed_git_mru(struct repository *r);
230
-struct packed_git *get_all_packs(struct repository *r);
236
237
/*
238
* Give a rough count of objects in the repository. This sacrifices accuracy
server-info.c
+2
-1
@@ -287,12 +287,13 @@ static int compare_info(const void *a_, const void *b_)
287
288
static void init_pack_info(struct repository *r, const char *infofile, int force)
289
{
290
+ struct packfile_store *packs = r->objects->packfiles;
291
struct packed_git *p;
292
int stale;
293
int i;
294
size_t alloc = 0;
295
295
- for (p = get_all_packs(r); p; p = p->next) {
296
+ for (p = packfile_store_get_all_packs(packs); p; p = p->next) {
297
/* we ignore things on alternate path since they are
298
* not available to the pullers in general.
299
*/
t/helper/test-find-pack.c
+1
-1
@@ -39,7 +39,7 @@ int cmd__find_pack(int argc, const char **argv)
39
if (repo_get_oid(the_repository, argv[0], &oid))
40
die("cannot parse %s as an object name", argv[0]);
41
42
- for (p = get_all_packs(the_repository); p; p = p->next)
42
+ for (p = packfile_store_get_all_packs(the_repository->objects->packfiles); p; p = p->next)
43
if (find_pack_entry_one(&oid, p)) {
44
printf("%s\n", p->pack_name);
45
actual_count++;
t/helper/test-pack-mtimes.c
+1
-1
@@ -37,7 +37,7 @@ int cmd__pack_mtimes(int argc, const char **argv)
37
if (argc != 2)
38
usage(pack_mtimes_usage);
39
40
- for (p = get_all_packs(the_repository); p; p = p->next) {
40
+ for (p = packfile_store_get_all_packs(the_repository->objects->packfiles); p; p = p->next) {
41
strbuf_addstr(&buf, basename(p->pack_name));
42
strbuf_strip_suffix(&buf, ".pack");
43
strbuf_addstr(&buf, ".mtimes");