Skip to content

Commit e20a557

Browse files
pks-tgitster
authored andcommitted
odb: generic inmemory source
Make the in-memory source generic. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8ed6d16 commit e20a557

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

odb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static int do_oid_object_info_extended(struct object_database *odb,
560560
if (is_null_oid(real))
561561
return -1;
562562

563-
if (!odb_source_read_object_info(&odb->inmemory_objects->base, oid, oi, flags))
563+
if (!odb_source_read_object_info(odb->inmemory_objects, oid, oi, flags))
564564
return 0;
565565

566566
odb_prepare_alternates(odb);
@@ -737,7 +737,7 @@ int odb_pretend_object(struct object_database *odb,
737737
if (odb_has_object(odb, oid, 0))
738738
return 0;
739739

740-
return odb_source_write_object(&odb->inmemory_objects->base,
740+
return odb_source_write_object(odb->inmemory_objects,
741741
buf, len, type, oid, NULL, 0);
742742
}
743743

@@ -1020,7 +1020,7 @@ struct object_database *odb_new(struct repository *repo,
10201020
o->sources = odb_source_new(o, primary_source, true);
10211021
o->sources_tail = &o->sources->next;
10221022
o->alternate_db = xstrdup_or_null(secondary_sources);
1023-
o->inmemory_objects = odb_source_inmemory_new(o);
1023+
o->inmemory_objects = &odb_source_inmemory_new(o)->base;
10241024

10251025
free(to_free);
10261026

@@ -1045,7 +1045,7 @@ static void odb_free_sources(struct object_database *o)
10451045
o->sources = next;
10461046
}
10471047

1048-
odb_source_free(&o->inmemory_objects->base);
1048+
odb_source_free(o->inmemory_objects);
10491049
o->inmemory_objects = NULL;
10501050

10511051
kh_destroy_odb_path_map(o->source_by_path);

odb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct object_database {
9999
* to write them into the object store (e.g. a browse-only
100100
* application).
101101
*/
102-
struct odb_source_inmemory *inmemory_objects;
102+
struct odb_source *inmemory_objects;
103103

104104
/*
105105
* A fast, rough count of the number of objects in the repository.

0 commit comments

Comments
 (0)