aboutsummaryrefslogtreecommitdiff
path: root/odb/source-files.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-05 15:19:53 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-05 11:45:16 -0800
commit6e76c3ab69f9b30530d50550a2feb7d8bda935db (patch)
treecbd9a7639b440c128063475489576c39b993b9ec /odb/source-files.c
parent6a38b13fbac73d1a1982f9211c5c3e64e1191696 (diff)
downloadgit-6e76c3ab69f9b30530d50550a2feb7d8bda935db.tar.xz
odb/source: make `write_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/source-files.c')
-rw-r--r--odb/source-files.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/source-files.c b/odb/source-files.c
index a6447909e0..67c2aff659 100644
--- a/odb/source-files.c
+++ b/odb/source-files.c
@@ -98,6 +98,17 @@ static int odb_source_files_freshen_object(struct odb_source *source,
return 0;
}
+static int odb_source_files_write_object(struct odb_source *source,
+ const void *buf, unsigned long len,
+ enum object_type type,
+ struct object_id *oid,
+ struct object_id *compat_oid,
+ unsigned flags)
+{
+ return odb_source_loose_write_object(source, buf, len, type,
+ oid, compat_oid, flags);
+}
+
struct odb_source_files *odb_source_files_new(struct object_database *odb,
const char *path,
bool local)
@@ -116,6 +127,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,
files->base.read_object_stream = odb_source_files_read_object_stream;
files->base.for_each_object = odb_source_files_for_each_object;
files->base.freshen_object = odb_source_files_freshen_object;
+ files->base.write_object = odb_source_files_write_object;
/*
* Ideally, we would only ever store absolute paths in the source. This