aboutsummaryrefslogtreecommitdiff
path: root/odb.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-05 15:19:52 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-05 11:45:16 -0800
commit6a38b13fbac73d1a1982f9211c5c3e64e1191696 (patch)
tree5476c9e8b1b91e9189384d434676ea906be52d8e /odb.c
parentfdefdc2e6979e9e8cb28b34c458f42b44f217bf0 (diff)
downloadgit-6a38b13fbac73d1a1982f9211c5c3e64e1191696.tar.xz
odb/source: make `freshen_object()` 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.c')
-rw-r--r--odb.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/odb.c b/odb.c
index 494a3273cf..c9f42c5afd 100644
--- a/odb.c
+++ b/odb.c
@@ -959,18 +959,10 @@ int odb_freshen_object(struct object_database *odb,
const struct object_id *oid)
{
struct odb_source *source;
-
odb_prepare_alternates(odb);
- for (source = odb->sources; source; source = source->next) {
- struct odb_source_files *files = odb_source_files_downcast(source);
-
- if (packfile_store_freshen_object(files->packed, oid))
+ for (source = odb->sources; source; source = source->next)
+ if (odb_source_freshen_object(source, oid))
return 1;
-
- if (odb_source_loose_freshen_object(source, oid))
- return 1;
- }
-
return 0;
}