t7411: merge tests 5 and 6
authorAntonio Ospite <ao2@ao2.it>
Fri, 5 Oct 2018 13:05:54 +0000 (15:05 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Oct 2018 03:40:20 +0000 (12:40 +0900)
Tests 5 and 6 check for the effects of the same commit, merge the two
tests to make it more straightforward to clean things up after the test
has finished.

The cleanup will be added in a future commit.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7411-submodule-config.sh
index 0bde5850ac547c90dadd9e21341ebad80a1471e6..f2cd1f4a2c540beb8c71e79641ac7a7fd2de7f14 100755 (executable)
@@ -82,29 +82,21 @@ Submodule name: 'a' for path 'b'
 Submodule name: 'submodule' for path 'submodule'
 EOF
 
-test_expect_success 'error in one submodule config lets continue' '
+test_expect_success 'error in history of one submodule config lets continue, stderr message contains blob ref' '
        (cd super &&
                cp .gitmodules .gitmodules.bak &&
                echo "  value = \"" >>.gitmodules &&
                git add .gitmodules &&
                mv .gitmodules.bak .gitmodules &&
                git commit -m "add error" &&
-               test-tool submodule-config \
-                       HEAD b \
-                       HEAD submodule \
-                               >actual &&
-               test_cmp expect_error actual
-       )
-'
-
-test_expect_success 'error message contains blob reference' '
-       (cd super &&
                sha1=$(git rev-parse HEAD) &&
                test-tool submodule-config \
                        HEAD b \
                        HEAD submodule \
-                               2>actual_err &&
-               test_i18ngrep "submodule-blob $sha1:.gitmodules" actual_err >/dev/null
+                               >actual \
+                               2>actual_stderr &&
+               test_cmp expect_error actual &&
+               test_i18ngrep "submodule-blob $sha1:.gitmodules" actual_stderr >/dev/null
        )
 '