MCPcopy Create free account
hub / github.com/git/git / bisect_start

Function bisect_start

builtin/bisect.c:711–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711static 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]);

Callers 3

bisect_autostartFunction · 0.85
process_replay_lineFunction · 0.85
cmd_bisect__startFunction · 0.85

Calls 15

is_bare_repositoryFunction · 0.85
errorFunction · 0.85
xstrdupFunction · 0.85
starts_withFunction · 0.85
get_oidfFunction · 0.85
oid_to_hexFunction · 0.85
refs_resolve_ref_unsafeFunction · 0.85
get_main_ref_storeFunction · 0.85
repo_get_oidFunction · 0.85
is_empty_or_missing_fileFunction · 0.85
strbuf_read_fileFunction · 0.85
strbuf_trimFunction · 0.85

Tested by

no test coverage detected