Browse Source

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>
maint
Eric Sunshine 7 years ago committed by Junio C Hamano
parent
commit
ed6c994af4
  1. 4
      t/t0001-init.sh
  2. 2
      t/t1300-config.sh

4
t/t0001-init.sh

@ -408,7 +408,7 @@ is_hidden () { @@ -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' ' @@ -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

2
t/t1300-config.sh

@ -888,7 +888,7 @@ EOF @@ -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 &&

Loading…
Cancel
Save