Skip to content

Commit 49cd044

Browse files
committed
Merge branch 'revert-upstream-midx-regression'
This topic reverts a regression in v2.45.x where it no longer expires multi-pack indices correctly, resulting in way too many packs that cannot be expired. This work-around will be upstreamed at a later date. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents b105301 + fa9d858 commit 49cd044

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

midx-write.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,8 +1499,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
14991499
repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset);
15001500
repo_config_get_bool(r, "repack.usedeltaislands", &use_delta_islands);
15011501

1502-
strvec_pushl(&cmd.args, "pack-objects", "--stdin-packs", "--non-empty",
1503-
NULL);
1502+
strvec_push(&cmd.args, "pack-objects");
15041503

15051504
strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
15061505

@@ -1524,15 +1523,16 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
15241523
}
15251524

15261525
cmd_in = xfdopen(cmd.in, "w");
1527-
for (i = 0; i < m->num_packs; i++) {
1528-
struct packed_git *p = m->packs[i];
1529-
if (!p)
1526+
1527+
for (i = 0; i < m->num_objects; i++) {
1528+
struct object_id oid;
1529+
uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
1530+
1531+
if (!include_pack[pack_int_id])
15301532
continue;
15311533

1532-
if (include_pack[i])
1533-
fprintf(cmd_in, "%s\n", pack_basename(p));
1534-
else
1535-
fprintf(cmd_in, "^%s\n", pack_basename(p));
1534+
nth_midxed_object_oid(&oid, m, i);
1535+
fprintf(cmd_in, "%s\n", oid_to_hex(&oid));
15361536
}
15371537
fclose(cmd_in);
15381538

0 commit comments

Comments
 (0)