@@ -1142,8 +1142,14 @@ static int get_first_good(const char *refname UNUSED,
1142
1142
return 1 ;
1143
1143
}
1144
1144
1145
- static int verify_good (const struct bisect_terms * terms ,
1146
- const char * * quoted_argv )
1145
+ static int do_bisect_run (const char * command )
1146
+ {
1147
+ const char * argv [] = { command , NULL };
1148
+ printf (_ ("running %s\n" ), command );
1149
+ return run_command_v_opt (argv , RUN_USING_SHELL );
1150
+ }
1151
+
1152
+ static int verify_good (const struct bisect_terms * terms , const char * command )
1147
1153
{
1148
1154
int rc ;
1149
1155
enum bisect_error res ;
@@ -1163,8 +1169,7 @@ static int verify_good(const struct bisect_terms *terms,
1163
1169
if (res != BISECT_OK )
1164
1170
return -1 ;
1165
1171
1166
- printf (_ ("running %s\n" ), quoted_argv [0 ]);
1167
- rc = run_command_v_opt (quoted_argv , RUN_USING_SHELL );
1172
+ rc = do_bisect_run (command );
1168
1173
1169
1174
res = bisect_checkout (& current_rev , no_checkout );
1170
1175
if (res != BISECT_OK )
@@ -1177,7 +1182,6 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
1177
1182
{
1178
1183
int res = BISECT_OK ;
1179
1184
struct strbuf command = STRBUF_INIT ;
1180
- struct strvec run_args = STRVEC_INIT ;
1181
1185
const char * new_state ;
1182
1186
int temporary_stdout_fd , saved_stdout ;
1183
1187
int is_first_run = 1 ;
@@ -1192,11 +1196,8 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
1192
1196
return BISECT_FAILED ;
1193
1197
}
1194
1198
1195
- strvec_push (& run_args , command .buf );
1196
-
1197
1199
while (1 ) {
1198
- printf (_ ("running %s\n" ), command .buf );
1199
- res = run_command_v_opt (run_args .v , RUN_USING_SHELL );
1200
+ res = do_bisect_run (command .buf );
1200
1201
1201
1202
/*
1202
1203
* Exit code 126 and 127 can either come from the shell
@@ -1206,7 +1207,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
1206
1207
* missing or non-executable script.
1207
1208
*/
1208
1209
if (is_first_run && (res == 126 || res == 127 )) {
1209
- int rc = verify_good (terms , run_args . v );
1210
+ int rc = verify_good (terms , command . buf );
1210
1211
is_first_run = 0 ;
1211
1212
if (rc < 0 ) {
1212
1213
error (_ ("unable to verify '%s' on good"
@@ -1273,7 +1274,6 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
1273
1274
}
1274
1275
1275
1276
strbuf_release (& command );
1276
- strvec_clear (& run_args );
1277
1277
return res ;
1278
1278
}
1279
1279
0 commit comments