[PATCH 08/10] git submodule update: cmd_update_recursive
From: Stefan Beller <hidden>
Date: 2016-06-15 23:06:35
Subsystem:
the rest · Maintainer:
Linus Torvalds
split the recursion part out to its own function Signed-off-by: Stefan Beller <redacted> --- git-submodule.sh | 47 ++++++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 21 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 3ccb0b6..52c2967 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh@@ -582,6 +582,31 @@ cmd_deinit() done } + +cmd_update_recursive() +{ + if test -n "$recursive" + then + ( + prefix="$prefix$sm_path/" + clear_local_git_env + cd "$sm_path" && + eval cmd_update + ) + res=$? + if test $res -gt 0 + then + die_msg="$(eval_gettext "Failed to recurse into submodule path '\$displaypath'")" + if test $res -eq 1 + then + err="${err};$die_msg" + else + die_with_status $res "$die_msg" + fi + fi + fi +} + # # Update each submodule path to correct revision, using clone and checkout as needed #
@@ -790,27 +815,7 @@ Maybe you want to use 'update --init'?")" fi fi - if test -n "$recursive" - then - ( - prefix="$prefix$sm_path/" - clear_local_git_env - cd "$sm_path" && - eval cmd_update - ) - res=$? - if test $res -gt 0 - then - die_msg="$(eval_gettext "Failed to recurse into submodule path '\$displaypath'")" - if test $res -eq 1 - then - err="${err};$die_msg" - continue - else - die_with_status $res "$die_msg" - fi - fi - fi + cmd_update_recursive done if test -n "$err"
--
2.6.0.rc0.131.gf624c3d