t7411: merge tests 5 and 6

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>
This commit is contained in:
Antonio Ospite 2018-10-05 15:05:54 +02:00 committed by Junio C Hamano
parent 45f5ef3d77
commit d1b13df527

View File

@ -82,29 +82,21 @@ Submodule name: 'a' for path 'b'
Submodule name: 'submodule' for path 'submodule' Submodule name: 'submodule' for path 'submodule'
EOF 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 && (cd super &&
cp .gitmodules .gitmodules.bak && cp .gitmodules .gitmodules.bak &&
echo " value = \"" >>.gitmodules && echo " value = \"" >>.gitmodules &&
git add .gitmodules && git add .gitmodules &&
mv .gitmodules.bak .gitmodules && mv .gitmodules.bak .gitmodules &&
git commit -m "add error" && 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) && sha1=$(git rev-parse HEAD) &&
test-tool submodule-config \ test-tool submodule-config \
HEAD b \ HEAD b \
HEAD submodule \ HEAD submodule \
2>actual_err && >actual \
test_i18ngrep "submodule-blob $sha1:.gitmodules" actual_err >/dev/null 2>actual_stderr &&
test_cmp expect_error actual &&
test_i18ngrep "submodule-blob $sha1:.gitmodules" actual_stderr >/dev/null
) )
' '