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>
Eric Sunshine committed
Jul 1, 2018 at 20:23 UTC
ed6c994af407dd2bea110460657222e39a7d83ad
2 files changed
+3
-3
t/t0001-init.sh
+2
-2
@@ -408,7 +408,7 @@ is_hidden () {
408
test_expect_success MINGW '.git hidden' '
409
rm -rf newdir &&
410
(
411
- unset GIT_DIR GIT_WORK_TREE
411
+ sane_unset GIT_DIR GIT_WORK_TREE &&
412
mkdir newdir &&
413
cd newdir &&
414
git init &&
@@ -420,7 +420,7 @@ test_expect_success MINGW '.git hidden' '
420
test_expect_success MINGW 'bare git dir not hidden' '
421
rm -rf newdir &&
422
(
423
- unset GIT_DIR GIT_WORK_TREE GIT_CONFIG
423
+ sane_unset GIT_DIR GIT_WORK_TREE GIT_CONFIG &&
424
mkdir newdir &&
425
cd newdir &&
426
git --bare init
t/t1300-config.sh
+1
-1
@@ -888,7 +888,7 @@ EOF
888
889
test_expect_success !MINGW 'get --path copes with unset $HOME' '
890
(
891
- unset HOME;
891
+ sane_unset HOME &&
892
test_must_fail git config --get --path path.home \
893
>result 2>msg &&
894
git config --get --path path.normal >>result &&