| 1116 | } |
| 1117 | |
| 1118 | static int process_parents(struct rev_info *revs, struct commit *commit, |
| 1119 | struct prio_queue *queue) |
| 1120 | { |
| 1121 | struct commit_list *parent = commit->parents; |
| 1122 | unsigned pass_flags; |
| 1123 | |
| 1124 | if (commit->object.flags & ADDED) |
| 1125 | return 0; |
| 1126 | if (revs->do_not_die_on_missing_objects && |
| 1127 | oidset_contains(&revs->missing_commits, &commit->object.oid)) |
| 1128 | return 0; |
| 1129 | commit->object.flags |= ADDED; |
| 1130 | |
| 1131 | if (revs->include_check && |
| 1132 | !revs->include_check(commit, revs->include_check_data)) |
| 1133 | return 0; |
| 1134 | |
| 1135 | /* |
| 1136 | * If the commit is uninteresting, don't try to |
| 1137 | * prune parents - we want the maximal uninteresting |
| 1138 | * set. |
| 1139 | * |
| 1140 | * Normally we haven't parsed the parent |
| 1141 | * yet, so we won't have a parent of a parent |
| 1142 | * here. However, it may turn out that we've |
| 1143 | * reached this commit some other way (where it |
| 1144 | * wasn't uninteresting), in which case we need |
| 1145 | * to mark its parents recursively too.. |
| 1146 | */ |
| 1147 | if (commit->object.flags & UNINTERESTING) { |
| 1148 | while (parent) { |
| 1149 | struct commit *p = parent->item; |
| 1150 | parent = parent->next; |
| 1151 | if (p) |
| 1152 | p->object.flags |= UNINTERESTING | |
| 1153 | CHILD_VISITED; |
| 1154 | if (repo_parse_commit_gently(revs->repo, p, 1) < 0) |
| 1155 | continue; |
| 1156 | if (p->parents) |
| 1157 | mark_parents_uninteresting(revs, p); |
| 1158 | if (p->object.flags & SEEN) |
| 1159 | continue; |
| 1160 | p->object.flags |= (SEEN | NOT_USER_GIVEN); |
| 1161 | if (queue) |
| 1162 | prio_queue_put(queue, p); |
| 1163 | if (revs->exclude_first_parent_only) |
| 1164 | break; |
| 1165 | } |
| 1166 | return 0; |
| 1167 | } |
| 1168 | |
| 1169 | /* |
| 1170 | * Ok, the commit wasn't uninteresting. Try to |
| 1171 | * simplify the commit history and find the parent |
| 1172 | * that has no differences in the path set if one exists. |
| 1173 | */ |
| 1174 | try_to_simplify_commit(revs, commit); |
| 1175 |
no test coverage detected