summaryrefslogtreecommitdiff
path: root/builtin/submodule--helper.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-08-31 23:18:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-09-02 16:16:24 (GMT)
commitb0bff0be5463ebfb75a76ff8577b90ade439a437 (patch)
treee24ee1f8cdb1e998f957db50778c73240000529e /builtin/submodule--helper.c
parent9d02f9499ffe7af9ce7e449e482820d437f84026 (diff)
downloadgit-b0bff0be5463ebfb75a76ff8577b90ade439a437.zip
git-b0bff0be5463ebfb75a76ff8577b90ade439a437.tar.gz
git-b0bff0be5463ebfb75a76ff8577b90ade439a437.tar.bz2
submodule--helper: don't redundantly check "else if (res)"
The "res" variable must be true at this point in update_submodule(), as just a few lines above this we've unconditionally: if (!res) return 0; So we don't need to guard the "return 1" with an "else if (res)", we can return unconditionally at this point. See b3c5f5cb048 (submodule: move core cmd_update() logic to C, 2022-03-15) for the initial introduction of this code, this check of "res" has always been redundant. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Glen Choo <chooglen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/submodule--helper.c')
-rw-r--r--builtin/submodule--helper.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index befcd2d..557834f 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2445,8 +2445,7 @@ static int update_submodule(struct update_data *update_data)
update_data->displaypath);
if (res == 128)
exit(res);
- else if (res)
- return 1;
+ return 1;
}
return 0;