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>

Antonio Ospite committed Oct 5, 2018 at 15:05 UTC 996df4d08b349750f7af3f96888b0ed5d361a32a
1 file changed +5 -2
t/t7411-submodule-config.sh
+5 -2
@@ -83,6 +83,8 @@ Submodule name: 'submodule' for path 'submodule'
83 EOF
84
85 test_expect_success 'error in history of one submodule config lets continue, stderr message contains blob ref' '
86 + ORIG=$(git -C super rev-parse HEAD) &&
87 + test_when_finished "git -C super reset --hard $ORIG" &&
88 (cd super &&
89 cp .gitmodules .gitmodules.bak &&
90 echo " value = \"" >>.gitmodules &&
@@ -115,6 +117,8 @@ test_expect_success 'using different treeishs works' '
117 '
118
119 test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
120 + ORIG=$(git -C super rev-parse HEAD) &&
121 + test_when_finished "git -C super reset --hard $ORIG" &&
122 (cd super &&
123 git config -f .gitmodules \
124 submodule.submodule.fetchrecursesubmodules blabla &&
@@ -126,8 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
130 HEAD b \
131 HEAD submodule \
132 >actual &&
129 - test_cmp expect_error actual &&
130 - git reset --hard HEAD^
133 + test_cmp expect_error actual
134 )
135 '
136