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

Function odb_pretend_object

odb.c:732–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730}
731
732int odb_pretend_object(struct object_database *odb,
733 void *buf, size_t len, enum object_type type,
734 struct object_id *oid)
735{
736 hash_object_file(odb->repo->hash_algo, buf, len, type, oid);
737 if (odb_has_object(odb, oid, 0))
738 return 0;
739
740 return odb_source_write_object(odb->inmemory_objects,
741 buf, len, type, oid, NULL, 0);
742}
743
744void *odb_read_object(struct object_database *odb,
745 const struct object_id *oid,

Callers 1

fake_working_tree_commitFunction · 0.85

Calls 3

hash_object_fileFunction · 0.85
odb_has_objectFunction · 0.85
odb_source_write_objectFunction · 0.85

Tested by

no test coverage detected