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

Function read_attr_from_blob

attr.c:766–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766static 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
791static struct attr_stack *read_attr_from_index(struct index_state *istate,
792 const char *path, unsigned flags)

Callers 2

read_attr_from_indexFunction · 0.85
read_attrFunction · 0.85

Calls 3

get_tree_entryFunction · 0.85
odb_read_objectFunction · 0.85
read_attr_from_bufFunction · 0.85

Tested by

no test coverage detected