t/lib-submodule-update: fix "absorbing" test

This test has been dysfunctional since it was added by 259f3ee296 (lib-submodule-update.sh: define tests for recursing into submodules, 2017-03-14), however, the problem went unnoticed due to a broken &&-chain. The test wants to verify that replacing a submodule containing a .git directory will absorb the .git directory into the .git/modules/ of the superproject, and then replace the working tree content appropriate to the superproject. It is, therefore, incorrect to check if the submodule content still exists since the submodule will have been replaced by the content of the superproject. Fix this by removing the submodule content check, which also happens to be the line that broke the &&-chain. While at it, fix broken &&-chains in a couple neighboring tests. Helped-by: Stefan Beller <sbeller@google.com> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Jul 1, 2018 at 20:23 UTC e5d7e9f5164e90386622a80a9dfc4b1675bcc92b
1 file changed +2 -3
t/lib-submodule-update.sh
+2 -3
@@ -755,7 +755,7 @@ test_submodule_recursing_with_args_common() {
755 : >sub1/untrackedfile &&
756 test_must_fail $command replace_sub1_with_file &&
757 test_superproject_content origin/add_sub1 &&
758 - test_submodule_content sub1 origin/add_sub1
758 + test_submodule_content sub1 origin/add_sub1 &&
759 test -f sub1/untracked_file
760 )
761 '
@@ -842,7 +842,7 @@ test_submodule_switch_recursing_with_args () {
842 cd submodule_update &&
843 git branch -t add_sub1 origin/add_sub1 &&
844 : >sub1 &&
845 - echo sub1 >.git/info/exclude
845 + echo sub1 >.git/info/exclude &&
846 $command add_sub1 &&
847 test_superproject_content origin/add_sub1 &&
848 test_submodule_content sub1 origin/add_sub1
@@ -969,7 +969,6 @@ test_submodule_forced_switch_recursing_with_args () {
969 rm -rf .git/modules/sub1 &&
970 $command replace_sub1_with_directory &&
971 test_superproject_content origin/replace_sub1_with_directory &&
972 - test_submodule_content sub1 origin/modify_sub1
972 test_git_directory_exists sub1
973 )
974 '