From: Ævar Arnfjörð Bjarmason Date: Wed, 31 Aug 2022 23:18:00 +0000 (+0200) Subject: submodule--helper: don't redundantly check "else if (res)" X-Git-Tag: v2.38.0-rc0~19^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0bff0be5463ebfb75a76ff8577b90ade439a437;p=thirdparty%2Fgit.git 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 Reviewed-by: Glen Choo Signed-off-by: Junio C Hamano --- diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index befcd2d0d9..557834fa73 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;