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

Function stream_blob

builtin/unpack-objects.c:388–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388static void stream_blob(unsigned long size, unsigned nr)
389{
390 git_zstream zstream = { 0 };
391 struct input_zstream_data data = { 0 };
392 struct odb_write_stream in_stream = {
393 .read = feed_input_zstream,
394 .data = &data,
395 };
396 struct obj_info *info = &obj_list[nr];
397
398 data.zstream = &zstream;
399 git_inflate_init(&zstream);
400
401 if (odb_write_object_stream(the_repository->objects, &in_stream, size, &info->oid))
402 die(_("failed to write object in stream"));
403
404 if (data.status != Z_STREAM_END)
405 die(_("inflate returned (%d)"), data.status);
406 git_inflate_end(&zstream);
407
408 if (strict) {
409 struct blob *blob = lookup_blob(the_repository, &info->oid);
410
411 if (!blob)
412 die(_("invalid blob object from stream"));
413 blob->object.flags |= FLAG_WRITTEN;
414 }
415 info->obj = NULL;
416}
417
418static int resolve_against_held(unsigned nr, const struct object_id *base,
419 void *delta_data, unsigned long delta_size)

Callers 1

unpack_oneFunction · 0.70

Calls 5

git_inflate_initFunction · 0.85
odb_write_object_streamFunction · 0.85
git_inflate_endFunction · 0.85
lookup_blobFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected