t: use sane_unset() rather than 'unset' with broken &&-chain

These tests intentionally break the &&-chain after using 'unset' since
they don't know if 'unset' will succeed or fail and don't want a local
'unset' failure to fail the test overall. We can do better by using
sane_unset(), which can be linked into the &&-chain as usual.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Eric Sunshine 2018-07-01 20:23:43 -04:00 committed by Junio C Hamano
parent 0590ff26c4
commit ed6c994af4
2 changed files with 3 additions and 3 deletions

View file

@ -408,7 +408,7 @@ is_hidden () {
test_expect_success MINGW '.git hidden' '
rm -rf newdir &&
(
unset GIT_DIR GIT_WORK_TREE
sane_unset GIT_DIR GIT_WORK_TREE &&
mkdir newdir &&
cd newdir &&
git init &&
@ -420,7 +420,7 @@ test_expect_success MINGW '.git hidden' '
test_expect_success MINGW 'bare git dir not hidden' '
rm -rf newdir &&
(
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
mkdir newdir &&
cd newdir &&
git --bare init

View file

@ -888,7 +888,7 @@ EOF
test_expect_success !MINGW 'get --path copes with unset $HOME' '
(
unset HOME;
sane_unset HOME &&
test_must_fail git config --get --path path.home \
>result 2>msg &&
git config --get --path path.normal >>result &&