diff options
| author | Meet Soni <meetsoni3017@gmail.com> | 2025-09-19 13:56:42 +0530 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-19 10:02:55 -0700 |
| commit | 0bef41319c889e6409ea4c1369747a70cbae7c1f (patch) | |
| tree | fd7396a51d1314b22f40a1eb819537abc2b0ea68 | |
| parent | reftable-backend: implement 'optimize' action (diff) | |
| download | git-0bef41319c889e6409ea4c1369747a70cbae7c1f.tar.gz git-0bef41319c889e6409ea4c1369747a70cbae7c1f.zip | |
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>
| -rw-r--r-- | builtin/pack-refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c index 5e28d0f9e8..dfcf664524 100644 --- a/builtin/pack-refs.c +++ b/builtin/pack-refs.c @@ -51,7 +51,7 @@ int cmd_pack_refs(int argc, if (!pack_refs_opts.includes->nr) string_list_append(pack_refs_opts.includes, "refs/tags/*"); - ret = refs_pack_refs(get_main_ref_store(repo), &pack_refs_opts); + ret = refs_optimize(get_main_ref_store(repo), &pack_refs_opts); clear_ref_exclusions(&excludes); string_list_clear(&included_refs, 0); |
