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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jun 1, 2026 at 10:20 UTC 337b7fccba1cca8b7d9232b5e6e9ff53271f0398
2 files changed +7
odb/source-files.c
+1
@@ -36,6 +36,7 @@ static void odb_source_files_free(struct odb_source *source)
36 static void odb_source_files_close(struct odb_source *source)
37 {
38 struct odb_source_files *files = odb_source_files_downcast(source);
39 + odb_source_close(&files->loose->base);
40 packfile_store_close(files->packed);
41 }
42
odb/source-loose.c
+6
@@ -21,6 +21,11 @@ static void odb_source_loose_reprepare(struct odb_source *source)
21 odb_source_loose_clear_cache(loose);
22 }
23
24 +static void odb_source_loose_close(struct odb_source *source UNUSED)
25 +{
26 + /* Nothing to do. */
27 +}
28 +
29 static void odb_source_loose_reparent(const char *name UNUSED,
30 const char *old_cwd,
31 const char *new_cwd,
@@ -53,6 +58,7 @@ struct odb_source_loose *odb_source_loose_new(struct odb_source_files *files)
58 loose->files = files;
59
60 loose->base.free = odb_source_loose_free;
61 + loose->base.close = odb_source_loose_close;
62 loose->base.reprepare = odb_source_loose_reprepare;
63
64 if (!is_absolute_path(loose->base.path))