mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Support pre-commit from inside submodules
This commit is contained in:
parent
d6cf62532d
commit
c3c98afe4f
7 changed files with 92 additions and 26 deletions
|
|
@ -25,6 +25,13 @@ 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)
|
||||
# In git 1.9.1 (maybe others), git exports these while running pre-commit hooks
|
||||
# in submodules. In the general case this causes problems.
|
||||
# These are covered by test_install_in_submodule_and_run
|
||||
# Causes git clone to clone wrong thing
|
||||
os.environ.pop('GIT_DIR', None)
|
||||
# Causes 'error invalid object ...' during commit
|
||||
os.environ.pop('GIT_INDEX_FILE', None)
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue