mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
refs: add a optimize_required field to struct ref_storage_be
To allow users of the refs namespace to check if the reference backend requires optimization, add a new field `optimize_required` field to `struct ref_storage_be`. This field is of type `optimize_required_fn` which is also introduced in this commit. Modify the debug, files, packed and reftable backend to implement this field. A following commit will expose this via 'git pack-refs' and 'git refs optimize'. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Acked-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e35155588a
commit
f6c5ca387a
7
refs.c
7
refs.c
@@ -2318,6 +2318,13 @@ int refs_optimize(struct ref_store *refs, struct refs_optimize_opts *opts)
|
||||
return refs->be->optimize(refs, opts);
|
||||
}
|
||||
|
||||
int refs_optimize_required(struct ref_store *refs,
|
||||
struct refs_optimize_opts *opts,
|
||||
bool *required)
|
||||
{
|
||||
return refs->be->optimize_required(refs, opts, required);
|
||||
}
|
||||
|
||||
int reference_get_peeled_oid(struct repository *repo,
|
||||
const struct reference *ref,
|
||||
struct object_id *peeled_oid)
|
||||
|
||||
Reference in New Issue
Block a user