Skip to content

Commit 8179380

Browse files
pks-tgitster
authored andcommitted
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>
1 parent 1919e90 commit 8179380

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

odb/source-inmemory.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,32 @@ static int odb_source_inmemory_freshen_object(struct odb_source *source,
299299
return 0;
300300
}
301301

302+
static int odb_source_inmemory_begin_transaction(struct odb_source *source UNUSED,
303+
struct odb_transaction **out UNUSED)
304+
{
305+
return error("inmemory source does not support transactions");
306+
}
307+
308+
static int odb_source_inmemory_read_alternates(struct odb_source *source UNUSED,
309+
struct strvec *out UNUSED)
310+
{
311+
return 0;
312+
}
313+
314+
static int odb_source_inmemory_write_alternate(struct odb_source *source UNUSED,
315+
const char *alternate UNUSED)
316+
{
317+
return error("inmemory source does not support alternates");
318+
}
319+
320+
static void odb_source_inmemory_close(struct odb_source *source UNUSED)
321+
{
322+
}
323+
324+
static void odb_source_inmemory_reprepare(struct odb_source *source UNUSED)
325+
{
326+
}
327+
302328
static int inmemory_object_free(const struct object_id *oid UNUSED,
303329
void *node_data,
304330
void *cb_data UNUSED)
@@ -334,6 +360,8 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
334360
odb_source_init(&source->base, odb, ODB_SOURCE_INMEMORY, "source", false);
335361

336362
source->base.free = odb_source_inmemory_free;
363+
source->base.close = odb_source_inmemory_close;
364+
source->base.reprepare = odb_source_inmemory_reprepare;
337365
source->base.read_object_info = odb_source_inmemory_read_object_info;
338366
source->base.read_object_stream = odb_source_inmemory_read_object_stream;
339367
source->base.for_each_object = odb_source_inmemory_for_each_object;
@@ -342,6 +370,9 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
342370
source->base.write_object = odb_source_inmemory_write_object;
343371
source->base.write_object_stream = odb_source_inmemory_write_object_stream;
344372
source->base.freshen_object = odb_source_inmemory_freshen_object;
373+
source->base.begin_transaction = odb_source_inmemory_begin_transaction;
374+
source->base.read_alternates = odb_source_inmemory_read_alternates;
375+
source->base.write_alternate = odb_source_inmemory_write_alternate;
345376

346377
return source;
347378
}

0 commit comments

Comments
 (0)