From b0bff0be5463ebfb75a76ff8577b90ade439a437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 1 Sep 2022 01:18:00 +0200 Subject: submodule--helper: don't redundantly check "else if (res)" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Glen Choo Signed-off-by: Junio C Hamano 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; -- cgit v0.10.2-6-g49f6