| 4070 | } |
| 4071 | |
| 4072 | int rewrite_parents(struct rev_info *revs, struct commit *commit, |
| 4073 | rewrite_parent_fn_t rewrite_parent) |
| 4074 | { |
| 4075 | struct commit_list **pp = &commit->parents; |
| 4076 | while (*pp) { |
| 4077 | struct commit_list *parent = *pp; |
| 4078 | switch (rewrite_parent(revs, &parent->item)) { |
| 4079 | case rewrite_one_ok: |
| 4080 | break; |
| 4081 | case rewrite_one_noparents: |
| 4082 | *pp = parent->next; |
| 4083 | free(parent); |
| 4084 | continue; |
| 4085 | case rewrite_one_error: |
| 4086 | return -1; |
| 4087 | } |
| 4088 | pp = &parent->next; |
| 4089 | } |
| 4090 | remove_duplicate_parents(revs, commit); |
| 4091 | return 0; |
| 4092 | } |
| 4093 | |
| 4094 | static int commit_match(struct commit *commit, struct rev_info *opt) |
| 4095 | { |
no test coverage detected