odb/source-inmemory: 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 Apr 10, 2026 at 14:12 UTC 314fa0199ddc1a37069ab7c006a5b0bb8e72f45d
1 file changed +31
odb/source-inmemory.c
+31
@@ -303,6 +303,32 @@ static int odb_source_inmemory_freshen_object(struct odb_source *source,
303 return 0;
304 }
305
306 +static int odb_source_inmemory_begin_transaction(struct odb_source *source UNUSED,
307 + struct odb_transaction **out UNUSED)
308 +{
309 + return error("in-memory source does not support transactions");
310 +}
311 +
312 +static int odb_source_inmemory_read_alternates(struct odb_source *source UNUSED,
313 + struct strvec *out UNUSED)
314 +{
315 + return 0;
316 +}
317 +
318 +static int odb_source_inmemory_write_alternate(struct odb_source *source UNUSED,
319 + const char *alternate UNUSED)
320 +{
321 + return error("in-memory source does not support alternates");
322 +}
323 +
324 +static void odb_source_inmemory_close(struct odb_source *source UNUSED)
325 +{
326 +}
327 +
328 +static void odb_source_inmemory_reprepare(struct odb_source *source UNUSED)
329 +{
330 +}
331 +
332 static int inmemory_object_free(const struct object_id *oid UNUSED,
333 void *node_data,
334 void *cb_data UNUSED)
@@ -338,6 +364,8 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
364 odb_source_init(&source->base, odb, ODB_SOURCE_INMEMORY, "source", false);
365
366 source->base.free = odb_source_inmemory_free;
367 + source->base.close = odb_source_inmemory_close;
368 + source->base.reprepare = odb_source_inmemory_reprepare;
369 source->base.read_object_info = odb_source_inmemory_read_object_info;
370 source->base.read_object_stream = odb_source_inmemory_read_object_stream;
371 source->base.for_each_object = odb_source_inmemory_for_each_object;
@@ -346,6 +374,9 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
374 source->base.write_object = odb_source_inmemory_write_object;
375 source->base.write_object_stream = odb_source_inmemory_write_object_stream;
376 source->base.freshen_object = odb_source_inmemory_freshen_object;
377 + source->base.begin_transaction = odb_source_inmemory_begin_transaction;
378 + source->base.read_alternates = odb_source_inmemory_read_alternates;
379 + source->base.write_alternate = odb_source_inmemory_write_alternate;
380
381 return source;
382 }