@@ -501,6 +501,43 @@ static int odb_source_packed_freshen_object(struct odb_source *source,
501501 return 1 ;
502502}
503503
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+
504541void (* report_garbage )(unsigned seen_bits , const char * path );
505542
506543static 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)
715752 packed -> base .count_objects = odb_source_packed_count_objects ;
716753 packed -> base .find_abbrev_len = odb_source_packed_find_abbrev_len ;
717754 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 ;
718760
719761 if (!is_absolute_path (parent -> base .path ))
720762 chdir_notify_register (NULL , odb_source_packed_reparent , packed );
0 commit comments