| 386 | } |
| 387 | |
| 388 | static 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 | |
| 418 | static int resolve_against_held(unsigned nr, const struct object_id *base, |
| 419 | void *delta_data, unsigned long delta_size) |
no test coverage detected