| 614 | } |
| 615 | |
| 616 | int is_range_diff_range(const char *arg) |
| 617 | { |
| 618 | char *copy = xstrdup(arg); /* setup_revisions() modifies it */ |
| 619 | const char *argv[] = { "", copy, "--", NULL }; |
| 620 | int i, positive = 0, negative = 0; |
| 621 | struct rev_info revs; |
| 622 | |
| 623 | repo_init_revisions(the_repository, &revs, NULL); |
| 624 | if (setup_revisions(3, argv, &revs, NULL) == 1) { |
| 625 | for (i = 0; i < revs.pending.nr; i++) |
| 626 | if (revs.pending.objects[i].item->flags & UNINTERESTING) |
| 627 | negative++; |
| 628 | else |
| 629 | positive++; |
| 630 | for (i = 0; i < revs.pending.nr; i++) { |
| 631 | struct object *obj = revs.pending.objects[i].item; |
| 632 | |
| 633 | if (obj->type == OBJ_COMMIT) |
| 634 | clear_commit_marks((struct commit *)obj, |
| 635 | ALL_REV_FLAGS); |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | free(copy); |
| 640 | release_revisions(&revs); |
| 641 | return negative > 0 && positive > 0; |
| 642 | } |
no test coverage detected