From d17063862b7401fc2c9b31f0d2c2307129eb48fc Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 23 Nov 2015 16:30:24 -0800 Subject: [PATCH] Fix issue #300 by removing GIT_WORK_TREE env variable --- pre_commit/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pre_commit/main.py b/pre_commit/main.py index ce16acde..28c4f714 100644 --- a/pre_commit/main.py +++ b/pre_commit/main.py @@ -22,6 +22,9 @@ from pre_commit.runner import Runner # to install packages to the wrong place. We don't want anything to deal with # pyvenv os.environ.pop('__PYVENV_LAUNCHER__', None) +# https://github.com/pre-commit/pre-commit/issues/300 +# In git 2.6.3 (maybe others), git exports this while running pre-commit hooks +os.environ.pop('GIT_WORK_TREE', None) def main(argv=None):