Skip to content

Commit add2452

Browse files
Denton-Lgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 27691ca commit add2452

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/lib-submodule-update.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ test_submodule_forced_switch () {
630630
# Internal function; use test_submodule_switch_recursing_with_args() or
631631
# test_submodule_forced_switch_recursing_with_args() instead.
632632
test_submodule_recursing_with_args_common () {
633-
command="$1"
633+
command="$1 --recurse-submodules"
634634

635635
######################### Appearing submodule #########################
636636
# Switching to a commit letting a submodule appear checks it out ...
@@ -809,7 +809,7 @@ test_submodule_recursing_with_args_common () {
809809
# test_submodule_switch_recursing_with_args "$GIT_COMMAND"
810810
test_submodule_switch_recursing_with_args () {
811811
cmd_args="$1"
812-
command="git $cmd_args --recurse-submodules"
812+
command="git $cmd_args"
813813
test_submodule_recursing_with_args_common "$command"
814814

815815
RESULTDS=success
@@ -927,7 +927,7 @@ test_submodule_switch_recursing_with_args () {
927927
# away local changes in the superproject is allowed.
928928
test_submodule_forced_switch_recursing_with_args () {
929929
cmd_args="$1"
930-
command="git $cmd_args --recurse-submodules"
930+
command="git $cmd_args"
931931
test_submodule_recursing_with_args_common "$command"
932932

933933
RESULT=success

0 commit comments

Comments
 (0)