Skip to content

Commit d170638

Browse files
committed
Fix issue pre-commit#300 by removing GIT_WORK_TREE env variable
1 parent 66e8ed5 commit d170638

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pre_commit/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
# to install packages to the wrong place. We don't want anything to deal with
2323
# pyvenv
2424
os.environ.pop('__PYVENV_LAUNCHER__', None)
25+
# https://github.com/pre-commit/pre-commit/issues/300
26+
# In git 2.6.3 (maybe others), git exports this while running pre-commit hooks
27+
os.environ.pop('GIT_WORK_TREE', None)
2528

2629

2730
def main(argv=None):

0 commit comments

Comments
 (0)