diff options
| author | Karthik Nayak <karthik.188@gmail.com> | 2025-11-08 22:51:55 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-10 09:28:48 -0800 |
| commit | f6c5ca387a7693b16158826d157178be0ba439dc (patch) | |
| tree | 22414dc8c8c76b982258920622cc6646e8abe6fb /refs.h | |
| parent | e35155588aa9f0355eb7e116ea418c189479f62d (diff) | |
| download | git-f6c5ca387a7693b16158826d157178be0ba439dc.tar.gz | |
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.h')
| -rw-r--r-- | refs.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -521,6 +521,13 @@ struct refs_optimize_opts { int refs_optimize(struct ref_store *refs, struct refs_optimize_opts *opts); /* + * Check if refs backend can be optimized by calling 'refs_optimize'. + */ +int refs_optimize_required(struct ref_store *ref_store, + struct refs_optimize_opts *opts, + bool *required); + +/* * Setup reflog before using. Fill in err and return -1 on failure. */ int refs_create_reflog(struct ref_store *refs, const char *refname, |
