path: root/builtin/submodule--helper.c
diff options
authorÆvar Arnfjörð Bjarmason <>2022-08-31 23:18:02 (GMT)
committerJunio C Hamano <>2022-09-02 16:16:24 (GMT)
commit0b917a9f5cb21ca1655daf549108361602e912f3 (patch)
tree5b03d48cd74cac4e5de592dd3c2228a0e824fcbb /builtin/submodule--helper.c
parentaddda284cbcde90b8b541caf94f198ed2f6bd936 (diff)
submodule--helper: return "ret", not "1" from update_submodule()
Amend the update_submodule() function to return the failing "ret" on error, instead of overriding it with "1". This code was added in b3c5f5cb048 (submodule: move core cmd_update() logic to C, 2022-03-15), and this change ends up not making a difference as this function is only called in update_submodules(). If we return non-zero here we'll always in turn return "1" in module_update(). But if we didn't do that and returned any other non-zero exit code in update_submodules() we'd fail the test that's being amended here. We're still testing the status quo here. This change makes subsequent refactoring of update_submodule() easier, as we'll no longer need to worry about clobbering the "ret" we get from the run_command(). Signed-off-by: Ævar Arnfjörð Bjarmason <> Reviewed-by: Glen Choo <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/submodule--helper.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index d76ee03..d6a8273 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2445,7 +2445,7 @@ static int update_submodule(struct update_data *update_data)
if (ret == 128)
- return 1;
+ return ret;
return 0;