summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Antonio Ospite <ao2@ao2.it>2018-10-05 15:05:55 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-09 12:40:21 +0900
commit996df4d08b349750f7af3f96888b0ed5d361a32a (patch)
treeb391bf153fc2a8e9db6418df70f6c90ef37ca22d
parentt7411: merge tests 5 and 6 (diff)
downloadtgif-996df4d08b349750f7af3f96888b0ed5d361a32a.tar.xz
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>
-rwxr-xr-xt/t7411-submodule-config.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh
index f2cd1f4a2c..b1f3c6489b 100755
--- a/t/t7411-submodule-config.sh
+++ b/t/t7411-submodule-config.sh
@@ -83,6 +83,8 @@ Submodule name: 'submodule' for path 'submodule'
EOF
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 &&
cp .gitmodules .gitmodules.bak &&
echo " value = \"" >>.gitmodules &&
@@ -115,6 +117,8 @@ test_expect_success 'using different treeishs works' '
'
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 &&
git config -f .gitmodules \
submodule.submodule.fetchrecursesubmodules blabla &&
@@ -126,8 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
HEAD b \
HEAD submodule \
>actual &&
- test_cmp expect_error actual &&
- git reset --hard HEAD^
+ test_cmp expect_error actual
)
'