Files
git/builtin
Victoria Dye 4b5a808bb9 repack: respect --keep-pack with geometric repack
Update 'repack' to ignore packs named on the command line with the
'--keep-pack' option. Specifically, modify 'init_pack_geometry()' to treat
command line-kept packs the same way it treats packs with an on-disk '.keep'
file (that is, skip the pack and do not include it in the 'geometry'
structure).

Without this handling, a '--keep-pack' pack would be included in the
'geometry' structure. If the pack is *before* the geometry split line (with
at least one other pack and/or loose objects present), 'repack' assumes the
pack's contents are "rolled up" into another pack via 'pack-objects'.
However, because the internally-invoked 'pack-objects' properly excludes
'--keep-pack' objects, any new pack it creates will not contain the kept
objects. Finally, 'repack' deletes the '--keep-pack' as "redundant" (since
it assumes 'pack-objects' created a new pack with its contents), resulting
in possible object loss and repository corruption.

Add a test ensuring that '--keep-pack' packs are now appropriately handled.

Co-authored-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-05-20 12:56:29 -07:00
..
2022-01-27 18:00:15 -08:00
2022-02-25 15:47:36 -08:00
2022-02-25 15:47:35 -08:00
2022-02-17 16:25:05 -08:00
2022-03-21 15:14:24 -07:00
2021-10-28 09:57:09 -07:00
2022-04-04 10:56:23 -07:00
2022-04-04 10:56:23 -07:00
2022-03-13 22:23:16 +00:00
2022-03-09 13:38:24 -08:00
2022-04-06 15:21:59 -07:00
2021-09-28 10:31:02 -07:00
2022-01-03 16:24:15 -08:00
2022-02-25 15:47:35 -08:00
2022-03-28 15:45:46 -07:00
2022-03-21 15:14:24 -07:00
2022-01-10 11:52:56 -08:00
2022-03-30 18:01:10 -07:00
2021-11-03 13:25:36 -07:00