From: Patrick Steinhardt Date: Mon, 1 Jun 2026 08:20:28 +0000 (+0200) Subject: odb/source-loose: wire up `close()` callback X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=337b7fccba1cca8b7d9232b5e6e9ff53271f0398;p=thirdparty%2Fgit.git odb/source-loose: wire up `close()` callback Wire up a new `close()` callback for the loose source and call it from the "files" source via the generic `odb_source_close()` interface. The callback itself is a no-op as the loose source has no resources that need to be released on close. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- diff --git a/odb/source-files.c b/odb/source-files.c index 10832e81e4..59e3a70d80 100644 --- a/odb/source-files.c +++ b/odb/source-files.c @@ -36,6 +36,7 @@ static void odb_source_files_free(struct odb_source *source) static void odb_source_files_close(struct odb_source *source) { struct odb_source_files *files = odb_source_files_downcast(source); + odb_source_close(&files->loose->base); packfile_store_close(files->packed); } diff --git a/odb/source-loose.c b/odb/source-loose.c index e0fe0d513d..65c1076659 100644 --- a/odb/source-loose.c +++ b/odb/source-loose.c @@ -21,6 +21,11 @@ static void odb_source_loose_reprepare(struct odb_source *source) odb_source_loose_clear_cache(loose); } +static void odb_source_loose_close(struct odb_source *source UNUSED) +{ + /* Nothing to do. */ +} + static void odb_source_loose_reparent(const char *name UNUSED, const char *old_cwd, const char *new_cwd, @@ -53,6 +58,7 @@ struct odb_source_loose *odb_source_loose_new(struct odb_source_files *files) loose->files = files; loose->base.free = odb_source_loose_free; + loose->base.close = odb_source_loose_close; loose->base.reprepare = odb_source_loose_reprepare; if (!is_absolute_path(loose->base.path))