MCPcopy Create free account
hub / github.com/git/git / odb_read_stream_open

Function odb_read_stream_open

odb/streaming.c:211–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211struct odb_read_stream *odb_read_stream_open(struct object_database *odb,
212 const struct object_id *oid,
213 struct stream_filter *filter)
214{
215 struct odb_read_stream *st;
216 const struct object_id *real = lookup_replace_object(odb->repo, oid);
217 int ret = istream_source(&st, odb, real);
218
219 if (ret)
220 return NULL;
221
222 if (filter) {
223 /* Add "&& !is_null_stream_filter(filter)" for performance */
224 struct odb_read_stream *nst = attach_stream_filter(st, filter);
225 if (!nst) {
226 odb_read_stream_close(st);
227 return NULL;
228 }
229 st = nst;
230 }
231
232 return st;
233}
234
235ssize_t odb_write_stream_read(struct odb_write_stream *st, void *buf, size_t sz)
236{

Callers 6

write_zip_entryFunction · 0.85
stream_blockedFunction · 0.85
parse_object_with_flagsFunction · 0.85
check_collisonFunction · 0.85
write_no_reuse_objectFunction · 0.85
odb_stream_blob_to_fdFunction · 0.85

Calls 4

lookup_replace_objectFunction · 0.85
istream_sourceFunction · 0.85
attach_stream_filterFunction · 0.85
odb_read_stream_closeFunction · 0.85

Tested by

no test coverage detected