diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-07-24 01:54:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-07-24 01:54:33 +0200 |
commit | ec9d46588ec063685b4abfbe13dfd9da39c77d7c (patch) | |
tree | 5a95ec8d4b9ad7439fa2c3930e17bb03fcb487db /midx-write.c | |
parent | Git 2.46-rc1 (diff) | |
parent | midx-write: revert use of --stdin-packs (diff) | |
download | git-ec9d46588ec063685b4abfbe13dfd9da39c77d7c.tar.xz git-ec9d46588ec063685b4abfbe13dfd9da39c77d7c.zip |
Merge branch 'ds/midx-write-repack-fix'
Repacking a repository with multi-pack index started making stupid
pack selections in Git 2.45, which has been corrected.
* ds/midx-write-repack-fix:
midx-write: revert use of --stdin-packs
t5319: add failing test case for repack/expire
Diffstat (limited to 'midx-write.c')
-rw-r--r-- | midx-write.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/midx-write.c b/midx-write.c index 478b42e720..a77ee73c68 100644 --- a/midx-write.c +++ b/midx-write.c @@ -1499,8 +1499,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); @@ -1524,15 +1523,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); |