t / t0029-core-unsetenvvars.shon commit rebase --abort/--quit: cleanup refs/rewritten (d559f50)
   1#!/bin/sh
   2
   3test_description='test the Windows-only core.unsetenvvars setting'
   4
   5. ./test-lib.sh
   6
   7if ! test_have_prereq MINGW
   8then
   9        skip_all='skipping Windows-specific tests'
  10        test_done
  11fi
  12
  13test_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
  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