aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-11-10 23:36:37 +0700
committerTaylor Blau <me@ttaylorr.com>2022-11-11 17:05:50 -0500
commitbdd2aa8a8bc46efce4a300d3cd6e169d89e99bc8 (patch)
treede2278c15c0016869f2a673669456ac09a23fc2f
parentbisect tests: test for v2.30.0 "bisect run" regressions (diff)
downloadgit-bdd2aa8a8bc46efce4a300d3cd6e169d89e99bc8.tar.gz
git-bdd2aa8a8bc46efce4a300d3cd6e169d89e99bc8.zip
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 <avarab@gmail.com> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
-rw-r--r--builtin/bisect--helper.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/bisect--helper.c b/builtin/bisect--helper.c
index 6e41cbdb2d..08d83e6867 100644
--- a/builtin/bisect--helper.c
+++ b/builtin/bisect--helper.c
@@ -1191,13 +1191,12 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
if (bisect_next_check(terms, NULL))
return BISECT_FAILED;
- if (argc)
- sq_quote_argv(&command, argv);
- else {
+ if (!argc) {
error(_("bisect run failed: no command provided."));
return BISECT_FAILED;
}
+ sq_quote_argv(&command, argv);
while (1) {
res = do_bisect_run(command.buf);
@@ -1268,7 +1267,7 @@ static int bisect_run(struct bisect_terms *terms, const char **argv, int argc)
res = BISECT_OK;
} else if (res) {
error(_("bisect run failed: 'git bisect--helper --bisect-state"
- " %s' exited with error code %d"), new_state, res);
+ " %s' exited with error code %d"), new_state, res);
} else {
continue;
}