mirror of
https://github.com/git/git.git
synced 2026-04-11 17:30:08 +02:00
refs: add a generic 'optimize' API
The existing `pack-refs` API is conceptually tied to the 'files' backend, but its behavior is generic (e.g., it triggers compaction for reftable). This naming is confusing. Introduce a new generic refs_optimize() API that dispatches to a backend-specific implementation via a new 'optimize' vtable method. This lays the architectural groundwork for different reference backends (like 'files' and 'reftable') to provide their own storage optimization logic, which will be called from a single, generic entry point. 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>
This commit is contained in:
committed by
Junio C Hamano
parent
f814da676a
commit
8dfe077fb6
@@ -447,6 +447,8 @@ typedef int ref_transaction_commit_fn(struct ref_store *refs,
|
||||
|
||||
typedef int pack_refs_fn(struct ref_store *ref_store,
|
||||
struct pack_refs_opts *opts);
|
||||
typedef int optimize_fn(struct ref_store *ref_store,
|
||||
struct pack_refs_opts *opts);
|
||||
typedef int rename_ref_fn(struct ref_store *ref_store,
|
||||
const char *oldref, const char *newref,
|
||||
const char *logmsg);
|
||||
@@ -572,6 +574,7 @@ struct ref_storage_be {
|
||||
ref_transaction_abort_fn *transaction_abort;
|
||||
|
||||
pack_refs_fn *pack_refs;
|
||||
optimize_fn *optimize;
|
||||
rename_ref_fn *rename_ref;
|
||||
copy_ref_fn *copy_ref;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user