lib-submodule-update: consolidate --recurse-submodules
Both test_submodule_switch_recursing_with_args() and test_submodule_forced_switch_recursing_with_args() call the internal function test_submodule_recursing_with_args_common() with the final argument of `--recurse-submodules`. Consolidate this duplication by appending the argument in test_submodule_recursing_with_args_common(). Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Apr 29, 2020 at 08:22 UTC
add245234820be6cec3f54174d44f738aa1a80f9
1 file changed
+3
-3
t/lib-submodule-update.sh
+3
-3
@@ -630,7 +630,7 @@ test_submodule_forced_switch () {
630
# Internal function; use test_submodule_switch_recursing_with_args() or
631
# test_submodule_forced_switch_recursing_with_args() instead.
632
test_submodule_recursing_with_args_common () {
633
- command="$1"
633
+ command="$1 --recurse-submodules"
634
635
######################### Appearing submodule #########################
636
# Switching to a commit letting a submodule appear checks it out ...
@@ -809,7 +809,7 @@ test_submodule_recursing_with_args_common () {
809
# test_submodule_switch_recursing_with_args "$GIT_COMMAND"
810
test_submodule_switch_recursing_with_args () {
811
cmd_args="$1"
812
- command="git $cmd_args --recurse-submodules"
812
+ command="git $cmd_args"
813
test_submodule_recursing_with_args_common "$command"
814
815
RESULTDS=success
@@ -927,7 +927,7 @@ test_submodule_switch_recursing_with_args () {
927
# away local changes in the superproject is allowed.
928
test_submodule_forced_switch_recursing_with_args () {
929
cmd_args="$1"
930
- command="git $cmd_args --recurse-submodules"
930
+ command="git $cmd_args"
931
test_submodule_recursing_with_args_common "$command"
932
933
RESULT=success