]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/repack.c: pass `write_pack_opts` to `finish_pack_objects_cmd()`
authorTaylor Blau <me@ttaylorr.com>
Wed, 15 Oct 2025 22:29:27 +0000 (18:29 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Oct 2025 17:08:56 +0000 (10:08 -0700)
commit80db3cd18985609340f40b2b06f4ef9f86a2cbe0
tree4491e9da15bbf0f2ea001a5bb7d0b6cf7aaa684a
parent2f79c79bba0da415eed3a8e1b32823b7c388b7f4
builtin/repack.c: pass `write_pack_opts` to `finish_pack_objects_cmd()`

To prepare to move the `finish_pack_objects_cmd()` function out of the
builtin and into the repack.h API, there are a couple of things we need
to do first:

 - First, let's take advantage of `write_pack_opts_is_local()` function
   introduced in the previous commit instead of passing "local"
   explicitly.

 - Let's also avoid referring to the static 'packtmp' field within
   builtin/repack.c by instead accessing it through the write_pack_opts
   argument.

There are three callers which need to adjust themselves in order to
account for this change. The callers which reside in write_cruft_pack()
and write_filtered_pack() both already have an "opts" in scope, so they
can pass it through transparently.

The other call (at the bottom of `cmd_repack()`) needs to initialize its
own write_pack_opts to pass the necessary fields over to the direct call
to `finish_pack_objects_cmd()`.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/repack.c