diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-03-05 15:19:54 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-05 11:45:16 -0800 |
| commit | fc7fb0ef3575091bbc00d6bf8345c2da0c386052 (patch) | |
| tree | 1420b8f3f2519ca4ad977d367bd84c6bf1fb6f89 /odb/source-files.c | |
| parent | 6e76c3ab69f9b30530d50550a2feb7d8bda935db (diff) | |
| download | git-fc7fb0ef3575091bbc00d6bf8345c2da0c386052.tar.xz | |
odb/source: make `write_object_stream()` 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.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/odb/source-files.c b/odb/source-files.c index 67c2aff659..b8844f11b7 100644 --- a/odb/source-files.c +++ b/odb/source-files.c @@ -109,6 +109,14 @@ static int odb_source_files_write_object(struct odb_source *source, oid, compat_oid, flags); } +static int odb_source_files_write_object_stream(struct odb_source *source, + struct odb_write_stream *stream, + size_t len, + struct object_id *oid) +{ + return odb_source_loose_write_stream(source, stream, len, oid); +} + struct odb_source_files *odb_source_files_new(struct object_database *odb, const char *path, bool local) @@ -128,6 +136,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb, 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; + files->base.write_object_stream = odb_source_files_write_object_stream; /* * Ideally, we would only ever store absolute paths in the source. This |
