MCPcopy Index your code
hub / github.com/git/git / read_blob_object

Function read_blob_object

apply.c:3380–3398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3378}
3379
3380static int read_blob_object(struct strbuf *buf, const struct object_id *oid, unsigned mode)
3381{
3382 if (S_ISGITLINK(mode)) {
3383 strbuf_grow(buf, 100);
3384 strbuf_addf(buf, "Subproject commit %s\n", oid_to_hex(oid));
3385 } else {
3386 enum object_type type;
3387 size_t sz;
3388 char *result;
3389
3390 result = odb_read_object(the_repository->objects, oid,
3391 &type, &sz);
3392 if (!result)
3393 return -1;
3394 /* XXX read_sha1_file NUL-terminates */
3395 strbuf_attach(buf, result, sz, sz + 1);
3396 }
3397 return 0;
3398}
3399
3400static int read_file_or_gitlink(const struct cache_entry *ce, struct strbuf *buf)
3401{

Callers 2

read_file_or_gitlinkFunction · 0.85
try_threewayFunction · 0.85

Calls 5

strbuf_growFunction · 0.85
strbuf_addfFunction · 0.85
oid_to_hexFunction · 0.85
odb_read_objectFunction · 0.85
strbuf_attachFunction · 0.85

Tested by

no test coverage detected