1#!/bin/sh
   2test_description='test the Windows-only core.unsetenvvars setting'
   4. ./test-lib.sh
   6if ! test_have_prereq MINGW
   8then
   9        skip_all='skipping Windows-specific tests'
  10        test_done
  11fi
  12test_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'
  19test_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'
  29test_done