Skip to content

Commit

Permalink
Revert "midx-write.c: use --stdin-packs when repacking"
Browse files Browse the repository at this point in the history
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 <stolee@gmail.com>
  • Loading branch information
derrickstolee committed Jul 16, 2024
1 parent 8f13388 commit 8177b6f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions midx-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1474,8 +1474,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
repo_config_get_bool(r, "repack.usedeltabaseoffset", &delta_base_offset);
repo_config_get_bool(r, "repack.usedeltaislands", &use_delta_islands);

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

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

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

cmd_in = xfdopen(cmd.in, "w");
for (i = 0; i < m->num_packs; i++) {
struct packed_git *p = m->packs[i];
if (!p)

for (i = 0; i < m->num_objects; i++) {
struct object_id oid;
uint32_t pack_int_id = nth_midxed_pack_int_id(m, i);

if (!include_pack[pack_int_id])
continue;

if (include_pack[i])
fprintf(cmd_in, "%s\n", pack_basename(p));
else
fprintf(cmd_in, "^%s\n", pack_basename(p));
nth_midxed_object_oid(&oid, m, i);
fprintf(cmd_in, "%s\n", oid_to_hex(&oid));
}
fclose(cmd_in);

Expand Down

0 comments on commit 8177b6f

Please sign in to comment.