[PATCH v3 15/17] odb/source-packed: stub out remaining functions
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 17, 2026, 06:39 UTC
- Message-ID
- <20260617-pks-odb-source-packed-v3-15-b5c7583cd795@pks.im>
- In-Reply-To
- <20260617-pks-odb-source-packed-v3-0-b5c7583cd795@pks.im>
Stub out remaining functions that we either don't need or that are basically no-ops.
Signed-off-by: Patrick Steinhardt <ps@pks.im> --- odb/source-packed.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/odb/source-packed.c b/odb/source-packed.c index e40b52e445..08a2de9bc5 100644 --- a/odb/source-packed.c +++ b/odb/source-packed.c @@ -501,6 +501,43 @@ static int odb_source_packed_freshen_object(struct odb_source *source, return 1; } +static int odb_source_packed_write_object(struct odb_source *source UNUSED, + const void *buf UNUSED, + unsigned long len UNUSED, + enum object_type type UNUSED, + struct object_id *oid UNUSED, + struct object_id *compat_oid UNUSED, + unsigned flags UNUSED) +{ + return error("packed backend cannot write objects"); +} + +static int odb_source_packed_write_object_stream(struct odb_source *source UNUSED, + struct odb_write_stream *stream UNUSED, + size_t len UNUSED, + struct object_id *oid UNUSED) +{ + return error("packed backend cannot write object streams"); +} + +static int odb_source_packed_begin_transaction(struct odb_source *source UNUSED, + struct odb_transaction **out UNUSED) +{ + return error("packed backend cannot begin transactions"); +} + +static int odb_source_packed_read_alternates(struct odb_source *source UNUSED, + struct strvec *out UNUSED) +{ + return 0; +} + +static int odb_source_packed_write_alternate(struct odb_source *source UNUSED, + const char *alternate UNUSED) +{ + return error("packed backend cannot write alternates"); +} + void (*report_garbage)(unsigned seen_bits, const char *path); static void report_helper(const struct string_list *list, @@ -715,6 +752,11 @@ struct odb_source_packed *odb_source_packed_new(struct odb_source_files *parent) packed->base.count_objects = odb_source_packed_count_objects; packed->base.find_abbrev_len = odb_source_packed_find_abbrev_len; packed->base.freshen_object = odb_source_packed_freshen_object; + packed->base.write_object = odb_source_packed_write_object; + packed->base.write_object_stream = odb_source_packed_write_object_stream; + packed->base.begin_transaction = odb_source_packed_begin_transaction; + packed->base.read_alternates = odb_source_packed_read_alternates; + packed->base.write_alternate = odb_source_packed_write_alternate; if (!is_absolute_path(parent->base.path)) chdir_notify_register(NULL, odb_source_packed_reparent, packed);
-- 2.55.0.rc0.786.g65d90a0328.dirty