| 2626 | } |
| 2627 | |
| 2628 | static void parse_from_existing(struct branch *b) |
| 2629 | { |
| 2630 | if (is_null_oid(&b->oid)) { |
| 2631 | oidclr(&b->branch_tree.versions[0].oid, the_repository->hash_algo); |
| 2632 | oidclr(&b->branch_tree.versions[1].oid, the_repository->hash_algo); |
| 2633 | } else { |
| 2634 | unsigned long size; |
| 2635 | size_t size_st = 0; |
| 2636 | char *buf; |
| 2637 | |
| 2638 | buf = odb_read_object_peeled(the_repository->objects, &b->oid, |
| 2639 | OBJ_COMMIT, &size_st, &b->oid); |
| 2640 | size = cast_size_t_to_ulong(size_st); |
| 2641 | parse_from_commit(b, buf, size); |
| 2642 | free(buf); |
| 2643 | } |
| 2644 | } |
| 2645 | |
| 2646 | static int parse_objectish(struct branch *b, const char *objectish) |
| 2647 | { |
no test coverage detected