Files
git-mirror/builtin
Taylor Blau d278970aef repack: move pack_kept_objects to struct pack_objects_args
The "pack_kept_objects" variable is defined as static to the repack
builtin, but is inherently related to the pack-objects arguments that
the builtin uses when generating new packs.

Move that field into the "struct pack_objects_args", and shuffle around
where we append the corresponding command-line option when preparing a
pack-objects process. Specifically:

 - `write_cruft_pack()` always wants to pass "--honor-pack-keep", so
   explicitly set the `pack_kept_objects` field to "0" when initializing
   the `write_pack_opts` struct before calling `write_cruft_pack()`.

 - `write_filtered_pack()` no longer needs to handle writing the
   command-line option "--honor-pack-keep" when preparing a pack-objects
   process, since its call to `prepare_pack_objects()` will have already
   taken care of that.

   `write_filtered_pack()` also reads the `pack_kept_objects` field to
   determine whether to write the existing kept packs with a leading "^"
   character, so update that to read through the `po_args` pointer
   instead.

 - `cmd_repack()` also no longer has to write the "--honor-pack-keep"
   flag explicitly, since this is also handled via its call to
   `prepare_pack_objects()`.

Since there is a default value for "pack_kept_objects" that relies on
whether or not we are writing a bitmap (and not writing a MIDX), extract
a default initializer for `struct pack_objects_args` that keeps this
conditional default behavior.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-10-16 10:08:57 -07:00
..
2025-08-21 13:46:59 -07:00
2024-12-13 07:33:36 -08:00
2025-07-23 08:15:18 -07:00
2025-08-21 13:47:00 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-07-01 14:46:38 -07:00
2025-08-22 13:13:20 -07:00
2025-09-10 14:29:49 -07:00
2024-12-18 10:44:31 -08:00
2025-08-21 13:47:00 -07:00
2025-07-16 22:16:15 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2025-08-21 13:47:00 -07:00
2025-07-23 08:15:18 -07:00
2025-09-02 09:58:35 -07:00
2025-08-21 13:46:58 -07:00
2025-09-04 11:36:40 -07:00
2025-07-23 08:15:18 -07:00
2025-08-04 08:10:33 -07:00
2025-09-10 14:29:49 -07:00
2025-07-23 08:15:18 -07:00
2025-07-23 08:15:18 -07:00
2024-12-18 10:44:30 -08:00
2025-08-21 13:46:59 -07:00