1141
return 1;
1142
}
1143
1144
-static int do_bisect_run(const char *command, const char *unquoted_cmd)
1144
+static int do_bisect_run(const char *command)
1145
{
1146
struct child_process cmd = CHILD_PROCESS_INIT;
1147
1148
- printf(_("running %s\n"), unquoted_cmd);
1148
+ printf(_("running %s\n"), command);
1149
cmd.use_shell = 1;
1150
strvec_push(&cmd.args, command);
1151
return run_command(&cmd);
1152
}
1153
1154
-static int verify_good(const struct bisect_terms *terms, const char *command, const char *unquoted_cmd)
1154
+static int verify_good(const struct bisect_terms *terms, const char *command)
1155
{
1156
int rc;
1157
enum bisect_error res;
1171
if (res != BISECT_OK)
1172
return -1;
1173
1174
- rc = do_bisect_run(command, unquoted_cmd);
1174
+ rc = do_bisect_run(command);
1175
1176
res = bisect_checkout(¤t_rev, no_checkout);
1177
if (res != BISECT_OK)
1184
{
1185
int res = BISECT_OK;
1186
struct strbuf command = STRBUF_INIT;
1187
- struct strbuf unquoted = STRBUF_INIT;
1187
const char *new_state;
1188
int temporary_stdout_fd, saved_stdout;
1189
int is_first_run = 1;
1197
}
1198
1199
sq_quote_argv(&command, argv);
1201
- strbuf_join_argv(&unquoted, argc, argv,' ');
1200
+ strbuf_ltrim(&command);
1201
while (1) {
1203
- res = do_bisect_run(command.buf, unquoted.buf);
1202
+ res = do_bisect_run(command.buf);
1203
1204
/*
1205
* Exit code 126 and 127 can either come from the shell
1209
* missing or non-executable script.
1210
*/
1211
if (is_first_run && (res == 126 || res == 127)) {
1213
- int rc = verify_good(terms, command.buf, unquoted.buf);
1212
+ int rc = verify_good(terms, command.buf);
1213
is_first_run = 0;
1214
if (rc < 0) {
1216
- error(_("unable to verify '%s' on good"
1217
- " revision"), unquoted.buf);
1215
+ error(_("unable to verify %s on good"
1216
+ " revision"), command.buf);
1217
res = BISECT_FAILED;
1218
break;
1219
}
1227
1228
if (res < 0 || 128 <= res) {
1229
error(_("bisect run failed: exit code %d from"
1231
- " '%s' is < 0 or >= 128"), res, unquoted.buf);
1230
+ " %s is < 0 or >= 128"), res, command.buf);
1231
break;
1232
}
1233
1264
puts(_("bisect run success"));
1265
res = BISECT_OK;
1266
} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
1268
- puts(_("bisect run success"));
1267
+ puts(_("bisect found first bad commit"));
1268
res = BISECT_OK;
1269
} else if (res) {
1270
error(_("bisect run failed: 'bisect-state %s'"
1275
break;
1276
}
1277
1279
- strbuf_release(&unquoted);
1278
strbuf_release(&command);
1279
return res;
1280
}