| 709 | } |
| 710 | |
| 711 | static enum bisect_error bisect_start(struct bisect_terms *terms, int argc, |
| 712 | const char **argv) |
| 713 | { |
| 714 | int no_checkout = 0; |
| 715 | int first_parent_only = 0; |
| 716 | int i, has_double_dash = 0, must_write_terms = 0, bad_seen = 0; |
| 717 | int flags, pathspec_pos; |
| 718 | enum bisect_error res = BISECT_OK; |
| 719 | struct string_list revs = STRING_LIST_INIT_DUP; |
| 720 | struct string_list states = STRING_LIST_INIT_DUP; |
| 721 | struct strbuf start_head = STRBUF_INIT; |
| 722 | struct strbuf bisect_names = STRBUF_INIT; |
| 723 | struct object_id head_oid; |
| 724 | struct object_id oid; |
| 725 | const char *head; |
| 726 | |
| 727 | if (is_bare_repository()) |
| 728 | no_checkout = 1; |
| 729 | |
| 730 | /* |
| 731 | * Check for one bad and then some good revisions |
| 732 | */ |
| 733 | for (i = 0; i < argc; i++) { |
| 734 | if (!strcmp(argv[i], "--")) { |
| 735 | has_double_dash = 1; |
| 736 | break; |
| 737 | } |
| 738 | } |
| 739 | |
| 740 | for (i = 0; i < argc; i++) { |
| 741 | const char *arg = argv[i]; |
| 742 | if (!strcmp(argv[i], "--")) { |
| 743 | break; |
| 744 | } else if (!strcmp(arg, "--no-checkout")) { |
| 745 | no_checkout = 1; |
| 746 | } else if (!strcmp(arg, "--first-parent")) { |
| 747 | first_parent_only = 1; |
| 748 | } else if (!strcmp(arg, "--term-good") || |
| 749 | !strcmp(arg, "--term-old")) { |
| 750 | i++; |
| 751 | if (argc <= i) |
| 752 | return error(_("'' is not a valid term")); |
| 753 | must_write_terms = 1; |
| 754 | free((void *) terms->term_good); |
| 755 | terms->term_good = xstrdup(argv[i]); |
| 756 | } else if (skip_prefix(arg, "--term-good=", &arg) || |
| 757 | skip_prefix(arg, "--term-old=", &arg)) { |
| 758 | must_write_terms = 1; |
| 759 | free((void *) terms->term_good); |
| 760 | terms->term_good = xstrdup(arg); |
| 761 | } else if (!strcmp(arg, "--term-bad") || |
| 762 | !strcmp(arg, "--term-new")) { |
| 763 | i++; |
| 764 | if (argc <= i) |
| 765 | return error(_("'' is not a valid term")); |
| 766 | must_write_terms = 1; |
| 767 | free((void *) terms->term_bad); |
| 768 | terms->term_bad = xstrdup(argv[i]); |
no test coverage detected