summaryrefslogtreecommitdiff
path: root/refs/refs-internal.h
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2025-11-08 22:51:55 +0100
committerJunio C Hamano <gitster@pobox.com>2025-11-10 09:28:48 -0800
commitf6c5ca387a7693b16158826d157178be0ba439dc (patch)
tree22414dc8c8c76b982258920622cc6646e8abe6fb /refs/refs-internal.h
parente35155588aa9f0355eb7e116ea418c189479f62d (diff)
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>
Diffstat (limited to 'refs/refs-internal.h')
-rw-r--r--refs/refs-internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index dee42f231d..c7d2a6e50b 100644
--- a/refs/refs-internal.h
+++ b/refs/refs-internal.h
@@ -424,6 +424,11 @@ typedef int ref_transaction_commit_fn(struct ref_store *refs,
typedef int optimize_fn(struct ref_store *ref_store,
struct refs_optimize_opts *opts);
+
+typedef int optimize_required_fn(struct ref_store *ref_store,
+ struct refs_optimize_opts *opts,
+ bool *required);
+
typedef int rename_ref_fn(struct ref_store *ref_store,
const char *oldref, const char *newref,
const char *logmsg);
@@ -549,6 +554,7 @@ struct ref_storage_be {
ref_transaction_abort_fn *transaction_abort;
optimize_fn *optimize;
+ optimize_required_fn *optimize_required;
rename_ref_fn *rename_ref;
copy_ref_fn *copy_ref;