Skip to content

Commit bdd2aa8

Browse files
avarttaylorr
authored andcommitted
bisect: refactor bisect_run() to match CodingGuidelines
We didn't add "{}" to all "if/else" branches, and one "error" was mis-indented. Let's fix that first, which makes subsequent commits smaller. In the case of the "if" we can simply early return instead. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Đoàn Trần Công Danh <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 982fecf commit bdd2aa8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

builtin/bisect--helper.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,13 +1191,12 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
11911191
if (bisect_next_check(terms, NULL))
11921192
return BISECT_FAILED;
11931193

1194-
if (argc)
1195-
sq_quote_argv(&command, argv);
1196-
else {
1194+
if (!argc) {
11971195
error(_("bisect run failed: no command provided."));
11981196
return BISECT_FAILED;
11991197
}
12001198

1199+
sq_quote_argv(&command, argv);
12011200
while (1) {
12021201
res = do_bisect_run(command.buf);
12031202

@@ -1268,7 +1267,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
12681267
res = BISECT_OK;
12691268
} else if (res) {
12701269
error(_("bisect run failed: 'git bisect--helper --bisect-state"
1271-
" %s' exited with error code %d"), new_state, res);
1270+
" %s' exited with error code %d"), new_state, res);
12721271
} else {
12731272
continue;
12741273
}

0 commit comments

Comments
 (0)