| 4331 | } |
| 4332 | |
| 4333 | static void track_linear(struct rev_info *revs, struct commit *commit) |
| 4334 | { |
| 4335 | if (revs->track_first_time) { |
| 4336 | revs->linear = 1; |
| 4337 | revs->track_first_time = 0; |
| 4338 | } else { |
| 4339 | struct commit_list *p; |
| 4340 | for (p = revs->previous_parents; p; p = p->next) |
| 4341 | if (p->item == NULL || /* first commit */ |
| 4342 | oideq(&p->item->object.oid, &commit->object.oid)) |
| 4343 | break; |
| 4344 | revs->linear = p != NULL; |
| 4345 | } |
| 4346 | if (revs->reverse) { |
| 4347 | if (revs->linear) |
| 4348 | commit->object.flags |= TRACK_LINEAR; |
| 4349 | } |
| 4350 | commit_list_free(revs->previous_parents); |
| 4351 | revs->previous_parents = commit_list_copy(commit->parents); |
| 4352 | } |
| 4353 | |
| 4354 | enum rev_walk_mode { |
| 4355 | REV_WALK_REFLOG, |
no test coverage detected