Merge branch 'ab/ci-updates'
[git/debian.git] / t / t0029-core-unsetenvvars.sh
blobb138e1d9cbcd9c459e8e1ce3849a199cb177f57b
1 #!/bin/sh
3 test_description='test the Windows-only core.unsetenvvars setting'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 if ! test_have_prereq MINGW
9 then
10 skip_all='skipping Windows-specific tests'
11 test_done
14 test_expect_success 'setup' '
15 mkdir -p "$TRASH_DIRECTORY/.git/hooks" &&
16 write_script "$TRASH_DIRECTORY/.git/hooks/pre-commit" <<-\EOF
17 echo $HOBBES >&2
18 EOF
21 test_expect_success 'core.unsetenvvars works' '
22 HOBBES=Calvin &&
23 export HOBBES &&
24 git commit --allow-empty -m with 2>err &&
25 grep Calvin err &&
26 git -c core.unsetenvvars=FINDUS,HOBBES,CALVIN \
27 commit --allow-empty -m without 2>err &&
28 ! grep Calvin err
31 test_done