Johannes Schindelin | 0e218f9 | 2018-10-30 11:40:07 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='test the Windows-only core.unsetenvvars setting' |
| 4 | |
Ævar Arnfjörð Bjarmason | c150064 | 2021-10-12 15:56:37 +0200 | [diff] [blame] | 5 | TEST_PASSES_SANITIZE_LEAK=true |
Johannes Schindelin | 0e218f9 | 2018-10-30 11:40:07 -0700 | [diff] [blame] | 6 | . ./test-lib.sh |
| 7 | |
| 8 | if ! test_have_prereq MINGW |
| 9 | then |
| 10 | skip_all='skipping Windows-specific tests' |
| 11 | test_done |
| 12 | fi |
| 13 | |
| 14 | test_expect_success 'setup' ' |
Ævar Arnfjörð Bjarmason | bef805b | 2022-03-17 11:13:14 +0100 | [diff] [blame] | 15 | test_hook --setup pre-commit <<-\EOF |
Johannes Schindelin | 0e218f9 | 2018-10-30 11:40:07 -0700 | [diff] [blame] | 16 | echo $HOBBES >&2 |
| 17 | EOF |
| 18 | ' |
| 19 | |
| 20 | test_expect_success 'core.unsetenvvars works' ' |
| 21 | HOBBES=Calvin && |
| 22 | export HOBBES && |
| 23 | git commit --allow-empty -m with 2>err && |
| 24 | grep Calvin err && |
| 25 | git -c core.unsetenvvars=FINDUS,HOBBES,CALVIN \ |
| 26 | commit --allow-empty -m without 2>err && |
| 27 | ! grep Calvin err |
| 28 | ' |
| 29 | |
| 30 | test_done |