Skip to content

Commit 996df4d

Browse files
ao2gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d1b13df commit 996df4d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

t/t7411-submodule-config.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ Submodule name: 'submodule' for path 'submodule'
8383
EOF
8484

8585
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" &&
8688
(cd super &&
8789
cp .gitmodules .gitmodules.bak &&
8890
echo " value = \"" >>.gitmodules &&
@@ -115,6 +117,8 @@ test_expect_success 'using different treeishs works' '
115117
'
116118

117119
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" &&
118122
(cd super &&
119123
git config -f .gitmodules \
120124
submodule.submodule.fetchrecursesubmodules blabla &&
@@ -126,8 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
126130
HEAD b \
127131
HEAD submodule \
128132
>actual &&
129-
test_cmp expect_error actual &&
130-
git reset --hard HEAD^
133+
test_cmp expect_error actual
131134
)
132135
'
133136

0 commit comments

Comments
 (0)