Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da00fa9 commit cd61269Copy full SHA for cd61269
1 file changed
pre_commit/resources/hook-tmpl
@@ -54,8 +54,10 @@ def _run_legacy():
54
else:
55
stdin = None
56
57
- legacy_hook = os.path.join(HERE, '{}.legacy'.format(HOOK_TYPE))
58
- if os.access(legacy_hook, os.X_OK):
+ legacy_script = HOOK_TYPE + '.legacy'
+ is_legacy_executed = os.path.basename(__file__) == legacy_script
59
+ legacy_hook = os.path.join(HERE, legacy_script)
60
+ if not is_legacy_executed and os.access(legacy_hook, os.X_OK):
61
cmd = _norm_exe(legacy_hook) + (legacy_hook,) + tuple(sys.argv[1:])
62
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE if stdin else None)
63
proc.communicate(stdin)
0 commit comments