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:

committed by
Junio C Hamano

parent
0590ff26c4
commit
ed6c994af4
@ -408,7 +408,7 @@ is_hidden () {
|
|||||||
test_expect_success MINGW '.git hidden' '
|
test_expect_success MINGW '.git hidden' '
|
||||||
rm -rf newdir &&
|
rm -rf newdir &&
|
||||||
(
|
(
|
||||||
unset GIT_DIR GIT_WORK_TREE
|
sane_unset GIT_DIR GIT_WORK_TREE &&
|
||||||
mkdir newdir &&
|
mkdir newdir &&
|
||||||
cd newdir &&
|
cd newdir &&
|
||||||
git init &&
|
git init &&
|
||||||
@ -420,7 +420,7 @@ test_expect_success MINGW '.git hidden' '
|
|||||||
test_expect_success MINGW 'bare git dir not hidden' '
|
test_expect_success MINGW 'bare git dir not hidden' '
|
||||||
rm -rf newdir &&
|
rm -rf newdir &&
|
||||||
(
|
(
|
||||||
unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
|
sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
|
||||||
mkdir newdir &&
|
mkdir newdir &&
|
||||||
cd newdir &&
|
cd newdir &&
|
||||||
git --bare init
|
git --bare init
|
||||||
|
@ -888,7 +888,7 @@ EOF
|
|||||||
|
|
||||||
test_expect_success !MINGW 'get --path copes with unset $HOME' '
|
test_expect_success !MINGW 'get --path copes with unset $HOME' '
|
||||||
(
|
(
|
||||||
unset HOME;
|
sane_unset HOME &&
|
||||||
test_must_fail git config --get --path path.home \
|
test_must_fail git config --get --path path.home \
|
||||||
>result 2>msg &&
|
>result 2>msg &&
|
||||||
git config --get --path path.normal >>result &&
|
git config --get --path path.normal >>result &&
|
||||||
|
Reference in New Issue
Block a user