| 3378 | } |
| 3379 | |
| 3380 | static 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 | |
| 3400 | static int read_file_or_gitlink(const struct cache_entry *ce, struct strbuf *buf) |
| 3401 | { |
no test coverage detected