From dae0cbd2fa5d139a529d0d1514b0883f131d1e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 8 Jan 2021 16:22:33 +0200 Subject: [PATCH] check_executables_have_shebangs: avoid unneeded shebang reads on win32 --- pre_commit_hooks/check_executables_have_shebangs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pre_commit_hooks/check_executables_have_shebangs.py b/pre_commit_hooks/check_executables_have_shebangs.py index 2d2bd7df..19f7ed27 100644 --- a/pre_commit_hooks/check_executables_have_shebangs.py +++ b/pre_commit_hooks/check_executables_have_shebangs.py @@ -34,8 +34,7 @@ def _check_git_filemode(paths: Sequence[str]) -> int: tagmode = metadata.split(' ', 1)[0] is_executable = any(b in EXECUTABLE_VALUES for b in tagmode[-3:]) - has_shebang = _check_has_shebang(path) - if is_executable and not has_shebang: + if is_executable and not _check_has_shebang(path): _message(path) seen.add(path)