From 3bc3177ad7a472dd5fc45cff16b8f57e5800ebc2 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 5 Mar 2026 15:19:48 +0100 Subject: 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 Signed-off-by: Junio C Hamano --- odb/source-files.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'odb/source-files.c') 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; /* -- cgit v1.3