Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec72cb7

Browse files
author
Tristan Carel
committed
assert that the pre-commit script being executed is not the legacy
1 parent cd61269 commit ec72cb7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pre_commit/resources/hook-tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ def _run_legacy():
5757
legacy_script = HOOK_TYPE + '.legacy'
5858
is_legacy_executed = os.path.basename(__file__) == legacy_script
5959
legacy_hook = os.path.join(HERE, legacy_script)
60-
if not is_legacy_executed and os.access(legacy_hook, os.X_OK):
60+
assert not is_legacy_executed, __file__
61+
if os.access(legacy_hook, os.X_OK):
6162
cmd = _norm_exe(legacy_hook) + (legacy_hook,) + tuple(sys.argv[1:])
6263
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE if stdin else None)
6364
proc.communicate(stdin)

0 commit comments

Comments
 (0)