| 2615 | } |
| 2616 | |
| 2617 | static void parse_from_commit(struct branch *b, char *buf, unsigned long size) |
| 2618 | { |
| 2619 | if (!buf || size < the_hash_algo->hexsz + 6) |
| 2620 | die(_("not a valid commit: %s"), oid_to_hex(&b->oid)); |
| 2621 | if (memcmp("tree ", buf, 5) |
| 2622 | || get_oid_hex(buf + 5, &b->branch_tree.versions[1].oid)) |
| 2623 | die(_("the commit %s is corrupt"), oid_to_hex(&b->oid)); |
| 2624 | oidcpy(&b->branch_tree.versions[0].oid, |
| 2625 | &b->branch_tree.versions[1].oid); |
| 2626 | } |
| 2627 | |
| 2628 | static void parse_from_existing(struct branch *b) |
| 2629 | { |
no test coverage detected