]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/pack-refs: convert to use the generic refs_optimize() API
authorMeet Soni <meetsoni3017@gmail.com>
Fri, 19 Sep 2025 08:26:42 +0000 (13:56 +0530)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2025 17:02:55 +0000 (10:02 -0700)
commit0bef41319c889e6409ea4c1369747a70cbae7c1f
treefd7396a51d1314b22f40a1eb819537abc2b0ea68
parentda0849a71e08ad072700b7cd1a0cb8b6fb89c50a
builtin/pack-refs: convert to use the generic refs_optimize() API

The `git pack-refs` command behaves generically, triggering a pack for
the 'files' backend and a compaction for the 'reftable' backend.
However, the name of the command and its corresponding API is
conceptually tied to the 'files' backend implementation.

To create a cleaner, more generic interface, refactor `git pack-refs` to
use the new `refs_optimize()` API. "Optimize" is a better semantic term
for this generic action.

This change allows `git pack-refs` to act as a backend-agnostic frontend
for reference optimization, and paves the way for the new `git refs
optimize` command to do the same.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-refs.c