mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 17:14:43 +04: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:
commit
03ac3b0840
1 changed files with 10 additions and 0 deletions
|
|
@ -49,6 +49,16 @@ def _norm_exe(exe):
|
||||||
|
|
||||||
|
|
||||||
def _run_legacy():
|
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':
|
if HOOK_TYPE == 'pre-push':
|
||||||
stdin = getattr(sys.stdin, 'buffer', sys.stdin).read()
|
stdin = getattr(sys.stdin, 'buffer', sys.stdin).read()
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue