| 1146 | } |
| 1147 | |
| 1148 | static int bisect_visualize(struct bisect_terms *terms, int argc, |
| 1149 | const char **argv) |
| 1150 | { |
| 1151 | struct child_process cmd = CHILD_PROCESS_INIT; |
| 1152 | struct strbuf sb = STRBUF_INIT; |
| 1153 | |
| 1154 | if (bisect_next_check(terms, NULL) != 0) |
| 1155 | return BISECT_FAILED; |
| 1156 | |
| 1157 | cmd.no_stdin = 1; |
| 1158 | if (!argc) { |
| 1159 | if ((getenv("DISPLAY") || getenv("SESSIONNAME") || getenv("MSYSTEM") || |
| 1160 | getenv("SECURITYSESSIONID")) && exists_in_PATH("gitk")) { |
| 1161 | strvec_push(&cmd.args, "gitk"); |
| 1162 | } else { |
| 1163 | strvec_push(&cmd.args, "log"); |
| 1164 | cmd.git_cmd = 1; |
| 1165 | } |
| 1166 | } else { |
| 1167 | if (argv[0][0] == '-') { |
| 1168 | strvec_push(&cmd.args, "log"); |
| 1169 | cmd.git_cmd = 1; |
| 1170 | } else if (strcmp(argv[0], "tig") && !starts_with(argv[0], "git")) |
| 1171 | cmd.git_cmd = 1; |
| 1172 | |
| 1173 | strvec_pushv(&cmd.args, argv); |
| 1174 | } |
| 1175 | |
| 1176 | strvec_pushl(&cmd.args, "--bisect", "--", NULL); |
| 1177 | |
| 1178 | strbuf_read_file(&sb, git_path_bisect_names(), 0); |
| 1179 | sq_dequote_to_strvec(sb.buf, &cmd.args); |
| 1180 | strbuf_release(&sb); |
| 1181 | |
| 1182 | return run_command(&cmd); |
| 1183 | } |
| 1184 | |
| 1185 | static int get_first_good(const struct reference *ref, void *cb_data) |
| 1186 | { |
no test coverage detected