mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-29 13:48:07 -05:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
47b965079d
commit
05151cf360
17
odb/source.h
17
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
|
||||
|
||||
Reference in New Issue
Block a user