odb/source-packed: stub out remaining functions

Stub out remaining functions that we either don't need or that are basically no-ops. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Jun 17, 2026 at 08:39 UTC f236b0c38d11b97930608384eaddd210f74fc7ab
1 file changed +42
odb/source-packed.c
+42
@@ -501,6 +501,43 @@ static int odb_source_packed_freshen_object(struct odb_source *source,
501 return 1;
502 }
503
504 +static int odb_source_packed_write_object(struct odb_source *source UNUSED,
505 + const void *buf UNUSED,
506 + unsigned long len UNUSED,
507 + enum object_type type UNUSED,
508 + struct object_id *oid UNUSED,
509 + struct object_id *compat_oid UNUSED,
510 + unsigned flags UNUSED)
511 +{
512 + return error("packed backend cannot write objects");
513 +}
514 +
515 +static int odb_source_packed_write_object_stream(struct odb_source *source UNUSED,
516 + struct odb_write_stream *stream UNUSED,
517 + size_t len UNUSED,
518 + struct object_id *oid UNUSED)
519 +{
520 + return error("packed backend cannot write object streams");
521 +}
522 +
523 +static int odb_source_packed_begin_transaction(struct odb_source *source UNUSED,
524 + struct odb_transaction **out UNUSED)
525 +{
526 + return error("packed backend cannot begin transactions");
527 +}
528 +
529 +static int odb_source_packed_read_alternates(struct odb_source *source UNUSED,
530 + struct strvec *out UNUSED)
531 +{
532 + return 0;
533 +}
534 +
535 +static int odb_source_packed_write_alternate(struct odb_source *source UNUSED,
536 + const char *alternate UNUSED)
537 +{
538 + return error("packed backend cannot write alternates");
539 +}
540 +
541 void (*report_garbage)(unsigned seen_bits, const char *path);
542
543 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)
752 packed->base.count_objects = odb_source_packed_count_objects;
753 packed->base.find_abbrev_len = odb_source_packed_find_abbrev_len;
754 packed->base.freshen_object = odb_source_packed_freshen_object;
755 + packed->base.write_object = odb_source_packed_write_object;
756 + packed->base.write_object_stream = odb_source_packed_write_object_stream;
757 + packed->base.begin_transaction = odb_source_packed_begin_transaction;
758 + packed->base.read_alternates = odb_source_packed_read_alternates;
759 + packed->base.write_alternate = odb_source_packed_write_alternate;
760
761 if (!is_absolute_path(parent->base.path))
762 chdir_notify_register(NULL, odb_source_packed_reparent, packed);