blob: 4e8e90dd9824b33bd4420423a447decea46e848e [file] [log] [blame]
Johannes Schindelin0e218f92018-10-30 11:40:07 -07001#!/bin/sh
2
3test_description='test the Windows-only core.unsetenvvars setting'
4
Ævar Arnfjörð Bjarmasonc1500642021-10-12 15:56:37 +02005TEST_PASSES_SANITIZE_LEAK=true
Johannes Schindelin0e218f92018-10-30 11:40:07 -07006. ./test-lib.sh
7
8if ! test_have_prereq MINGW
9then
10 skip_all='skipping Windows-specific tests'
11 test_done
12fi
13
14test_expect_success 'setup' '
Ævar Arnfjörð Bjarmasonbef805b2022-03-17 11:13:14 +010015 test_hook --setup pre-commit <<-\EOF
Johannes Schindelin0e218f92018-10-30 11:40:07 -070016 echo $HOBBES >&2
17 EOF
18'
19
20test_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
30test_done