aboutsummaryrefslogtreecommitdiff
path: root/odb/source-files.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-05 15:19:48 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-05 11:45:15 -0800
commit3bc3177ad7a472dd5fc45cff16b8f57e5800ebc2 (patch)
treede69cb8d12c523123cbe61a6bb0e069811f269a7 /odb/source-files.c
parent05151cf3602d5ebaaa4e04c415e8481cb1c7ddf6 (diff)
downloadgit-3bc3177ad7a472dd5fc45cff16b8f57e5800ebc2.tar.xz
odb/source: make `close()` 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.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/odb/source-files.c b/odb/source-files.c
index d0f7ee072e..20a24f524a 100644
--- a/odb/source-files.c
+++ b/odb/source-files.c
@@ -28,6 +28,12 @@ static void odb_source_files_free(struct odb_source *source)
free(files);
}
+static void odb_source_files_close(struct odb_source *source)
+{
+ struct odb_source_files *files = odb_source_files_downcast(source);
+ packfile_store_close(files->packed);
+}
+
static void odb_source_files_reprepare(struct odb_source *source)
{
struct odb_source_files *files = odb_source_files_downcast(source);
@@ -47,6 +53,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.close = odb_source_files_close;
files->base.reprepare = odb_source_files_reprepare;
/*