| 50 | } |
| 51 | |
| 52 | static int decode_tree_entry_raw(struct object_id *oid, const char **path, |
| 53 | size_t *len, const struct git_hash_algo *algo, |
| 54 | const char *buf, unsigned long size) |
| 55 | { |
| 56 | uint16_t mode; |
| 57 | const unsigned hashsz = algo->rawsz; |
| 58 | |
| 59 | if (size < hashsz + 3 || buf[size - (hashsz + 1)]) { |
| 60 | return -1; |
| 61 | } |
| 62 | |
| 63 | *path = parse_mode(buf, &mode); |
| 64 | if (!*path || !**path) |
| 65 | return -1; |
| 66 | *len = strlen(*path) + 1; |
| 67 | |
| 68 | oidread(oid, (const unsigned char *)*path + *len, algo); |
| 69 | return 0; |
| 70 | } |
| 71 | |
| 72 | static int convert_tree_object(struct repository *repo, |
| 73 | struct strbuf *out, |
no test coverage detected