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

Function read_oid_strbuf

merge-ort.c:3712–3736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3710}
3711
3712static 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
3738static int blob_unchanged(struct merge_options *opt,
3739 const struct version_info *base,

Callers 1

blob_unchangedFunction · 0.85

Calls 4

odb_read_objectFunction · 0.85
path_msgFunction · 0.85
oid_to_hexFunction · 0.85
strbuf_attachFunction · 0.85

Tested by

no test coverage detected