| 3710 | } |
| 3711 | |
| 3712 | static int read_oid_strbuf(struct merge_options *opt, |
| 3713 | const struct object_id *oid, |
| 3714 | struct strbuf *dst, |
| 3715 | const char *path) |
| 3716 | { |
| 3717 | void *buf; |
| 3718 | enum object_type type; |
| 3719 | size_t size; |
| 3720 | buf = odb_read_object(opt->repo->objects, oid, &type, &size); |
| 3721 | if (!buf) { |
| 3722 | path_msg(opt, ERROR_OBJECT_READ_FAILED, 0, |
| 3723 | path, NULL, NULL, NULL, |
| 3724 | _("error: cannot read object %s"), oid_to_hex(oid)); |
| 3725 | return -1; |
| 3726 | } |
| 3727 | if (type != OBJ_BLOB) { |
| 3728 | free(buf); |
| 3729 | path_msg(opt, ERROR_OBJECT_NOT_A_BLOB, 0, |
| 3730 | path, NULL, NULL, NULL, |
| 3731 | _("error: object %s is not a blob"), oid_to_hex(oid)); |
| 3732 | return -1; |
| 3733 | } |
| 3734 | strbuf_attach(dst, buf, size, size + 1); |
| 3735 | return 0; |
| 3736 | } |
| 3737 | |
| 3738 | static int blob_unchanged(struct merge_options *opt, |
| 3739 | const struct version_info *base, |
no test coverage detected