aboutsummaryrefslogtreecommitdiffstats
path: root/refs
diff options
context:
space:
mode:
authorMeet Soni <meetsoni3017@gmail.com>2025-09-19 13:56:41 +0530
committerJunio C Hamano <gitster@pobox.com>2025-09-19 10:02:55 -0700
commitda0849a71e08ad072700b7cd1a0cb8b6fb89c50a (patch)
tree9097fe46be51c659d04ba9417b45dace2c64eb9b /refs
parentfiles-backend: implement 'optimize' action (diff)
downloadgit-da0849a71e08ad072700b7cd1a0cb8b6fb89c50a.tar.gz
git-da0849a71e08ad072700b7cd1a0cb8b6fb89c50a.zip
reftable-backend: implement 'optimize' action
To make the new generic `optimize` API fully functional, provide an implementation for the 'reftable' reference backend. For the reftable backend, the 'optimize' action is to compact its tables. The existing `reftable_be_pack_refs()` function already provides this logic, so the new `reftable_be_optimize()` function simply calls it. Wire up the new function to the `optimize` slot in the reftable backend's virtual table. 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>
Diffstat (limited to 'refs')
-rw-r--r--refs/reftable-backend.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/refs/reftable-backend.c b/refs/reftable-backend.c
index 570463da41..5dff1e08e5 100644
--- a/refs/reftable-backend.c
+++ b/refs/reftable-backend.c
@@ -1721,6 +1721,12 @@ out:
return ret;
}
+static int reftable_be_optimize(struct ref_store *ref_store,
+ struct pack_refs_opts *opts)
+{
+ return reftable_be_pack_refs(ref_store, opts);
+}
+
struct write_create_symref_arg {
struct reftable_ref_store *refs;
struct reftable_stack *stack;
@@ -2702,6 +2708,7 @@ struct ref_storage_be refs_be_reftable = {
.transaction_abort = reftable_be_transaction_abort,
.pack_refs = reftable_be_pack_refs,
+ .optimize = reftable_be_optimize,
.rename_ref = reftable_be_rename_ref,
.copy_ref = reftable_be_copy_ref,