Merge branch 'sg/test-bash-version-fix'
[git] / t / t0029-core-unsetenvvars.sh
1 #!/bin/sh
2
3 test_description='test the Windows-only core.unsetenvvars setting'
4
5 . ./test-lib.sh
6
7 if ! test_have_prereq MINGW
8 then
9         skip_all='skipping Windows-specific tests'
10         test_done
11 fi
12
13 test_expect_success 'setup' '
14         mkdir -p "$TRASH_DIRECTORY/.git/hooks" &&
15         write_script "$TRASH_DIRECTORY/.git/hooks/pre-commit" <<-\EOF
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