| 764 | } |
| 765 | |
| 766 | static struct attr_stack *read_attr_from_blob(struct index_state *istate, |
| 767 | const struct object_id *tree_oid, |
| 768 | const char *path, unsigned flags) |
| 769 | { |
| 770 | struct object_id oid; |
| 771 | size_t sz; |
| 772 | enum object_type type; |
| 773 | void *buf; |
| 774 | unsigned short mode; |
| 775 | |
| 776 | if (!tree_oid) |
| 777 | return NULL; |
| 778 | |
| 779 | if (get_tree_entry(istate->repo, tree_oid, path, &oid, &mode)) |
| 780 | return NULL; |
| 781 | |
| 782 | buf = odb_read_object(istate->repo->objects, &oid, &type, &sz); |
| 783 | if (!buf || type != OBJ_BLOB) { |
| 784 | free(buf); |
| 785 | return NULL; |
| 786 | } |
| 787 | |
| 788 | return read_attr_from_buf(buf, sz, path, flags); |
| 789 | } |
| 790 | |
| 791 | static struct attr_stack *read_attr_from_index(struct index_state *istate, |
| 792 | const char *path, unsigned flags) |
no test coverage detected