mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 21:40:19 -06:00
Merge pull request #981 from tristan0x/fix/infinite-process-recursion
Do not run legacy script again when this is the one being executed
This commit is contained in:
@@ -49,6 +49,16 @@ def _norm_exe(exe):
|
||||
|
||||
|
||||
def _run_legacy():
|
||||
if __file__.endswith('.legacy'):
|
||||
raise SystemExit(
|
||||
"bug: pre-commit's script is installed in migration mode\n"
|
||||
'run `pre-commit install -f --hook-type {}` to fix this\n\n'
|
||||
'Please report this bug at '
|
||||
'https://github.com/pre-commit/pre-commit/issues'.format(
|
||||
HOOK_TYPE,
|
||||
),
|
||||
)
|
||||
|
||||
if HOOK_TYPE == 'pre-push':
|
||||
stdin = getattr(sys.stdin, 'buffer', sys.stdin).read()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user