diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-04-06 15:42:49 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-04-06 15:42:49 -0700 |
| commit | 03311dca7f91f69e9e0c532fce1c1e3c0a9fa34d (patch) | |
| tree | 99942cb6e498bd5ff78b17ea65618125372e3876 /builtin/repack.c | |
| parent | d75badf83bc3fc8e47413970874bac681eeb5bbe (diff) | |
| parent | 9ad29df36d7c762677b5a4ecc6a6dc229c818b2a (diff) | |
| download | git-03311dca7f91f69e9e0c532fce1c1e3c0a9fa34d.tar.xz | |
Merge branch 'tb/stdin-packs-excluded-but-open'
pack-objects's --stdin-packs=follow mode learns to handle
excluded-but-open packs.
* tb/stdin-packs-excluded-but-open:
repack: mark non-MIDX packs above the split as excluded-open
pack-objects: support excluded-open packs with --stdin-packs
t7704: demonstrate failure with once-cruft objects above the geometric split
pack-objects: refactor `read_packs_list_from_stdin()` to use `strmap`
pack-objects: plug leak in `read_stdin_packs()`
Diffstat (limited to 'builtin/repack.c')
| -rw-r--r-- | builtin/repack.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/builtin/repack.c b/builtin/repack.c index f6bb04bef7..4c5a82c2c8 100644 --- a/builtin/repack.c +++ b/builtin/repack.c @@ -369,8 +369,23 @@ int cmd_repack(int argc, */ for (i = 0; i < geometry.split; i++) fprintf(in, "%s\n", pack_basename(geometry.pack[i])); - for (i = geometry.split; i < geometry.pack_nr; i++) - fprintf(in, "^%s\n", pack_basename(geometry.pack[i])); + for (i = geometry.split; i < geometry.pack_nr; i++) { + const char *basename = pack_basename(geometry.pack[i]); + char marker = '^'; + + if (!midx_must_contain_cruft && + !string_list_has_string(&existing.midx_packs, + basename)) { + /* + * Assume non-MIDX'd packs are not + * necessarily closed under + * reachability. + */ + marker = '!'; + } + + fprintf(in, "%c%s\n", marker, basename); + } fclose(in); } |
