aboutsummaryrefslogtreecommitdiff
path: root/odb/source-files.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-05 15:19:47 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-05 11:45:15 -0800
commit05151cf3602d5ebaaa4e04c415e8481cb1c7ddf6 (patch)
tree4e0ce63042fcf7d3a01660d66ca88a44ca8d57c9 /odb/source-files.c
parent47b965079ddd9ced04810d0a8738a1ca94f02268 (diff)
downloadgit-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-files.c')
-rw-r--r--odb/source-files.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/odb/source-files.c b/odb/source-files.c
index 65d7805c5a..d0f7ee072e 100644
--- a/odb/source-files.c
+++ b/odb/source-files.c
@@ -28,6 +28,13 @@ static void odb_source_files_free(struct odb_source *source)
free(files);
}
+static void odb_source_files_reprepare(struct odb_source *source)
+{
+ struct odb_source_files *files = odb_source_files_downcast(source);
+ odb_source_loose_reprepare(&files->base);
+ packfile_store_reprepare(files->packed);
+}
+
struct odb_source_files *odb_source_files_new(struct object_database *odb,
const char *path,
bool local)
@@ -40,6 +47,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,
files->packed = packfile_store_new(&files->base);
files->base.free = odb_source_files_free;
+ files->base.reprepare = odb_source_files_reprepare;
/*
* Ideally, we would only ever store absolute paths in the source. This