t7411: be nicer to future tests and really clean things up

Tests 5 and 7 in t/t7411-submodule-config.sh add two commits with
invalid lines in .gitmodules but then only the second commit is removed.

This may affect future subsequent tests if they assume that the
.gitmodules file has no errors.

Remove both the commits as soon as they are not needed anymore.

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:55 +02:00 committed by Junio C Hamano
parent d1b13df527
commit 996df4d08b

View File

@ -83,6 +83,8 @@ Submodule name: 'submodule' for path 'submodule'
EOF EOF
test_expect_success 'error in history of one submodule config lets continue, stderr message contains blob ref' ' test_expect_success 'error in history of one submodule config lets continue, stderr message contains blob ref' '
ORIG=$(git -C super rev-parse HEAD) &&
test_when_finished "git -C super reset --hard $ORIG" &&
(cd super && (cd super &&
cp .gitmodules .gitmodules.bak && cp .gitmodules .gitmodules.bak &&
echo " value = \"" >>.gitmodules && echo " value = \"" >>.gitmodules &&
@ -115,6 +117,8 @@ test_expect_success 'using different treeishs works' '
' '
test_expect_success 'error in history in fetchrecursesubmodule lets continue' ' test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
ORIG=$(git -C super rev-parse HEAD) &&
test_when_finished "git -C super reset --hard $ORIG" &&
(cd super && (cd super &&
git config -f .gitmodules \ git config -f .gitmodules \
submodule.submodule.fetchrecursesubmodules blabla && submodule.submodule.fetchrecursesubmodules blabla &&
@ -126,8 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
HEAD b \ HEAD b \
HEAD submodule \ HEAD submodule \
>actual && >actual &&
test_cmp expect_error actual && test_cmp expect_error actual
git reset --hard HEAD^
) )
' '