Skip to content

Commit da0849a

Browse files
inosmeetgitster
authored andcommitted
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 <[email protected]> Mentored-by: shejialuo <[email protected]> Signed-off-by: Meet Soni <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1fd6067 commit da0849a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

refs/reftable-backend.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,12 @@ static int reftable_be_pack_refs(struct ref_store *ref_store,
17211721
return ret;
17221722
}
17231723

1724+
static int reftable_be_optimize(struct ref_store *ref_store,
1725+
struct pack_refs_opts *opts)
1726+
{
1727+
return reftable_be_pack_refs(ref_store, opts);
1728+
}
1729+
17241730
struct write_create_symref_arg {
17251731
struct reftable_ref_store *refs;
17261732
struct reftable_stack *stack;
@@ -2702,6 +2708,7 @@ struct ref_storage_be refs_be_reftable = {
27022708
.transaction_abort = reftable_be_transaction_abort,
27032709

27042710
.pack_refs = reftable_be_pack_refs,
2711+
.optimize = reftable_be_optimize,
27052712
.rename_ref = reftable_be_rename_ref,
27062713
.copy_ref = reftable_be_copy_ref,
27072714

0 commit comments

Comments
 (0)