| 3480 | } |
| 3481 | |
| 3482 | static int remove_marked_parents(struct rev_info *revs, struct commit *commit) |
| 3483 | { |
| 3484 | struct commit_list **pp, *p; |
| 3485 | int nth_parent, removed = 0; |
| 3486 | |
| 3487 | pp = &commit->parents; |
| 3488 | nth_parent = 0; |
| 3489 | while ((p = *pp) != NULL) { |
| 3490 | struct commit *parent = p->item; |
| 3491 | if (parent->object.flags & TMP_MARK) { |
| 3492 | parent->object.flags &= ~TMP_MARK; |
| 3493 | *pp = p->next; |
| 3494 | free(p); |
| 3495 | removed++; |
| 3496 | compact_treesame(revs, commit, nth_parent); |
| 3497 | continue; |
| 3498 | } |
| 3499 | pp = &p->next; |
| 3500 | nth_parent++; |
| 3501 | } |
| 3502 | |
| 3503 | /* Removing parents can only increase TREESAMEness */ |
| 3504 | if (removed && !(commit->object.flags & TREESAME)) |
| 3505 | update_treesame(revs, commit); |
| 3506 | |
| 3507 | return nth_parent; |
| 3508 | } |
| 3509 | |
| 3510 | static struct commit_list **simplify_one(struct rev_info *revs, struct commit *commit, struct commit_list **tail) |
| 3511 | { |
no test coverage detected