Skip to content

Commit dcd7f1c

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 770c032 commit dcd7f1c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

odb/source-inmemory.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,32 @@ static int odb_source_inmemory_freshen_object(struct odb_source *source,
303303
return 0;
304304
}
305305

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+
306332
static int inmemory_object_free(const struct object_id *oid UNUSED,
307333
void *node_data,
308334
void *cb_data UNUSED)
@@ -338,6 +364,8 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
338364
odb_source_init(&source->base, odb, ODB_SOURCE_INMEMORY, "source", false);
339365

340366
source->base.free = odb_source_inmemory_free;
367+
source->base.close = odb_source_inmemory_close;
368+
source->base.reprepare = odb_source_inmemory_reprepare;
341369
source->base.read_object_info = odb_source_inmemory_read_object_info;
342370
source->base.read_object_stream = odb_source_inmemory_read_object_stream;
343371
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)
346374
source->base.write_object = odb_source_inmemory_write_object;
347375
source->base.write_object_stream = odb_source_inmemory_write_object_stream;
348376
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;
349380

350381
return source;
351382
}

0 commit comments

Comments
 (0)