Skip to content

Commit 8ed6d16

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 729a534 commit 8ed6d16

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
@@ -296,6 +296,32 @@ static int odb_source_inmemory_freshen_object(struct odb_source *source,
296296
return 0;
297297
}
298298

299+
static int odb_source_inmemory_begin_transaction(struct odb_source *source UNUSED,
300+
struct odb_transaction **out UNUSED)
301+
{
302+
return error("inmemory source does not support transactions");
303+
}
304+
305+
static int odb_source_inmemory_read_alternates(struct odb_source *source UNUSED,
306+
struct strvec *out UNUSED)
307+
{
308+
return 0;
309+
}
310+
311+
static int odb_source_inmemory_write_alternate(struct odb_source *source UNUSED,
312+
const char *alternate UNUSED)
313+
{
314+
return error("inmemory source does not support alternates");
315+
}
316+
317+
static void odb_source_inmemory_close(struct odb_source *source UNUSED)
318+
{
319+
}
320+
321+
static void odb_source_inmemory_reprepare(struct odb_source *source UNUSED)
322+
{
323+
}
324+
299325
static int inmemory_object_free(const struct object_id *oid UNUSED,
300326
void *node_data,
301327
void *cb_data UNUSED)
@@ -331,6 +357,8 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
331357
odb_source_init(&source->base, odb, ODB_SOURCE_INMEMORY, "source", false);
332358

333359
source->base.free = odb_source_inmemory_free;
360+
source->base.close = odb_source_inmemory_close;
361+
source->base.reprepare = odb_source_inmemory_reprepare;
334362
source->base.read_object_info = odb_source_inmemory_read_object_info;
335363
source->base.read_object_stream = odb_source_inmemory_read_object_stream;
336364
source->base.for_each_object = odb_source_inmemory_for_each_object;
@@ -339,6 +367,9 @@ struct odb_source_inmemory *odb_source_inmemory_new(struct object_database *odb)
339367
source->base.write_object = odb_source_inmemory_write_object;
340368
source->base.write_object_stream = odb_source_inmemory_write_object_stream;
341369
source->base.freshen_object = odb_source_inmemory_freshen_object;
370+
source->base.begin_transaction = odb_source_inmemory_begin_transaction;
371+
source->base.read_alternates = odb_source_inmemory_read_alternates;
372+
source->base.write_alternate = odb_source_inmemory_write_alternate;
342373

343374
return source;
344375
}

0 commit comments

Comments
 (0)