diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-03-05 15:19:47 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-05 11:45:15 -0800 |
| commit | 05151cf3602d5ebaaa4e04c415e8481cb1c7ddf6 (patch) | |
| tree | 4e0ce63042fcf7d3a01660d66ca88a44ca8d57c9 /odb/source.h | |
| parent | 47b965079ddd9ced04810d0a8738a1ca94f02268 (diff) | |
| download | git-05151cf3602d5ebaaa4e04c415e8481cb1c7ddf6.tar.xz | |
odb/source: make `reprepare()` function pluggable
Introduce a new callback function in `struct odb_source` to make the
function pluggable.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'odb/source.h')
| -rw-r--r-- | odb/source.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/odb/source.h b/odb/source.h index 4973fb4251..09cca839fe 100644 --- a/odb/source.h +++ b/odb/source.h @@ -57,6 +57,13 @@ struct odb_source { * all associated resources. The function will never be called with a NULL pointer. */ void (*free)(struct odb_source *source); + + /* + * This callback is expected to clear underlying caches of the object + * database source. The function is called when the repository has for + * example just been repacked so that new objects will become visible. + */ + void (*reprepare)(struct odb_source *source); }; /* @@ -96,4 +103,14 @@ void odb_source_free(struct odb_source *source); */ void odb_source_release(struct odb_source *source); +/* + * Reprepare the object database source and clear any caches. Depending on the + * backend used this may have the effect that concurrently-written objects + * become visible. + */ +static inline void odb_source_reprepare(struct odb_source *source) +{ + source->reprepare(source); +} + #endif |
