[PATCH 07/11] t7508: make test "set -e" clean
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 25, 2026, 06:21 UTC
- Message-ID
- <20260325062114.2067946-8-gitster@pobox.com>
- In-Reply-To
- <20260325062114.2067946-1-gitster@pobox.com>
In order to catch mistakes like misspelling "test_expect_success", we would like to eventually be able to run our test suite with the "-e" option on.
This test tries to unconditionally clear a few configuration variables, but "git config --unset VAR" fails if VAR is not set. Work it around by telling the shell that failures from them are OK.
Signed-off-by: Junio C Hamano <gitster@pobox.com> --- t/t7508-status.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh index a5e21bf8bf..1167b835a4 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -773,8 +773,8 @@ test_expect_success TTY 'status --porcelain ignores color.status' ' ' # recover unconditionally from color tests -git config --unset color.status -git config --unset color.ui +git config --unset color.status || : +git config --unset color.ui || : test_expect_success 'status --porcelain respects -b' '
-- 2.53.0-886-g529cbd14ff