Skip to content

Commit fa9d858

Browse files
derrickstoleedscho
authored andcommitted
Revert "midx-write.c: use --stdin-packs when repacking"
This reverts commit b7d6f23. This commit caused a regression in the incremental-repack maintenance step where not all objects in a pack-file are repacked, thus 'git multi-pack-index expire' cannot delete the pack-files. This will require some careful explanation upstream and some careful untangling of how server-side repacks may be depending on the new logic. Since microsoft/git only serves client users, it is safe to revert this in isolation for now. Signed-off-by: Derrick Stolee <[email protected]>
1 parent 91d03cb commit fa9d858

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
@@ -1474,8 +1474,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
14741474
repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset);
14751475
repo_config_get_bool(r, "repack.usedeltaislands", &use_delta_islands);
14761476

1477-
strvec_pushl(&cmd.args, "pack-objects", "--stdin-packs", "--non-empty",
1478-
NULL);
1477+
strvec_push(&cmd.args, "pack-objects");
14791478

14801479
strvec_pushf(&cmd.args, "%s/pack/pack", object_dir);
14811480

@@ -1499,15 +1498,16 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
14991498
}
15001499

15011500
cmd_in = xfdopen(cmd.in, "w");
1502-
for (i = 0; i < m->num_packs; i++) {
1503-
struct packed_git *p = m->packs[i];
1504-
if (!p)
1501+
1502+
for (i = 0; i < m->num_objects; i++) {
1503+
struct object_id oid;
1504+
uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);
1505+
1506+
if (!include_pack[pack_int_id])
15051507
continue;
15061508

1507-
if (include_pack[i])
1508-
fprintf(cmd_in, "%s\n", pack_basename(p));
1509-
else
1510-
fprintf(cmd_in, "^%s\n", pack_basename(p));
1509+
nth_midxed_object_oid(&oid, m, i);
1510+
fprintf(cmd_in, "%s\n", oid_to_hex(&oid));
15111511
}
15121512
fclose(cmd_in);
15131513

0 commit comments

Comments
 (0)