1141
return 1;
1142
}
1143
1144
-static int do_bisect_run(const char *command)
1144
+static int do_bisect_run(const char *command, const char *unquoted_cmd)
1145
{
1146
struct child_process cmd = CHILD_PROCESS_INIT;
1147
1148
- printf(_("running %s\n"), command);
1148
+ printf(_("running %s\n"), unquoted_cmd);
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)
1154
+static int verify_good(const struct bisect_terms *terms, const char *command, const char *unquoted_cmd)
1155
{
1156
int rc;
1157
enum bisect_error res;
1171
if (res != BISECT_OK)
1172
return -1;
1173
1174
- rc = do_bisect_run(command);
1174
+ rc = do_bisect_run(command, unquoted_cmd);
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;
1188
const char *new_state;
1189
int temporary_stdout_fd, saved_stdout;
1190
int is_first_run = 1;
1198
}
1199
1200
sq_quote_argv(&command, argv);
1201
+ strbuf_join_argv(&unquoted, argc, argv,' ');
1202
while (1) {
1201
- res = do_bisect_run(command.buf);
1203
+ res = do_bisect_run(command.buf, unquoted.buf);
1204
1205
/*
1206
* Exit code 126 and 127 can either come from the shell
1210
* missing or non-executable script.
1211
*/
1212
if (is_first_run && (res == 126 || res == 127)) {
1211
- int rc = verify_good(terms, command.buf);
1213
+ int rc = verify_good(terms, command.buf, unquoted.buf);
1214
is_first_run = 0;
1215
if (rc < 0) {
1216
error(_("unable to verify '%s' on good"
1215
- " revision"), command.buf);
1217
+ " revision"), unquoted.buf);
1218
res = BISECT_FAILED;
1219
break;
1220
}
1228
1229
if (res < 0 || 128 <= res) {
1230
error(_("bisect run failed: exit code %d from"
1229
- " '%s' is < 0 or >= 128"), res, command.buf);
1231
+ " '%s' is < 0 or >= 128"), res, unquoted.buf);
1232
break;
1233
}
1234
1262
if (res == BISECT_ONLY_SKIPPED_LEFT)
1263
error(_("bisect run cannot continue any more"));
1264
else if (res == BISECT_INTERNAL_SUCCESS_MERGE_BASE) {
1263
- printf(_("bisect run success"));
1265
+ puts(_("bisect run success"));
1266
res = BISECT_OK;
1267
} else if (res == BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND) {
1266
- printf(_("bisect found first bad commit"));
1268
+ puts(_("bisect run success"));
1269
res = BISECT_OK;
1270
} else if (res) {
1269
- error(_("bisect run failed: 'git bisect--helper --bisect-state"
1270
- " %s' exited with error code %d"), new_state, res);
1271
+ error(_("bisect run failed: 'bisect-state %s'"
1272
+ " exited with error code %d"), new_state, res);
1273
} else {
1274
continue;
1275
}
1276
break;
1277
}
1278
1279
+ strbuf_release(&unquoted);
1280
strbuf_release(&command);
1281
return res;
1282
}