| 99 | } |
| 100 | |
| 101 | static int odb_source_inmemory_read_object_stream(struct odb_read_stream **out, |
| 102 | struct odb_source *source, |
| 103 | const struct object_id *oid) |
| 104 | { |
| 105 | struct odb_source_inmemory *inmemory = odb_source_inmemory_downcast(source); |
| 106 | struct odb_read_stream_inmemory *stream; |
| 107 | const struct inmemory_object *object; |
| 108 | |
| 109 | object = find_cached_object(inmemory, oid); |
| 110 | if (!object) |
| 111 | return -1; |
| 112 | |
| 113 | CALLOC_ARRAY(stream, 1); |
| 114 | stream->base.read = odb_read_stream_inmemory_read; |
| 115 | stream->base.close = odb_read_stream_inmemory_close; |
| 116 | stream->base.size = object->size; |
| 117 | stream->base.type = object->type; |
| 118 | stream->buf = object->buf; |
| 119 | |
| 120 | *out = &stream->base; |
| 121 | return 0; |
| 122 | } |
| 123 | |
| 124 | struct odb_source_inmemory_for_each_object_data { |
| 125 | struct odb_source_inmemory *inmemory; |
nothing calls this directly
no test coverage detected