| 2661 | } |
| 2662 | |
| 2663 | static struct commit *find_single_final(struct rev_info *revs, |
| 2664 | const char **name_p) |
| 2665 | { |
| 2666 | int i; |
| 2667 | struct commit *found = NULL; |
| 2668 | const char *name = NULL; |
| 2669 | |
| 2670 | for (i = 0; i < revs->pending.nr; i++) { |
| 2671 | struct object *obj = revs->pending.objects[i].item; |
| 2672 | if (obj->flags & UNINTERESTING) |
| 2673 | continue; |
| 2674 | obj = deref_tag(revs->repo, obj, NULL, 0); |
| 2675 | if (!obj || obj->type != OBJ_COMMIT) |
| 2676 | die("Non commit %s?", revs->pending.objects[i].name); |
| 2677 | if (found) |
| 2678 | die("More than one commit to dig from %s and %s?", |
| 2679 | revs->pending.objects[i].name, name); |
| 2680 | found = (struct commit *)obj; |
| 2681 | name = revs->pending.objects[i].name; |
| 2682 | } |
| 2683 | if (name_p) |
| 2684 | *name_p = xstrdup_or_null(name); |
| 2685 | return found; |
| 2686 | } |
| 2687 | |
| 2688 | static struct commit *dwim_reverse_initial(struct rev_info *revs, |
| 2689 | const char **name_p) |
no test coverage detected