Skip to content

Commit 0a88f14

Browse files
authored
Merge pull request #730 from Kurt-von-Laven/support-git-file-mode-false
Check Git core.fileMode rather than infer from OS.
2 parents 974bb4d + 2cbabf9 commit 0a88f14

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pre_commit_hooks/check_executables_have_shebangs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515

1616

1717
def check_executables(paths: list[str]) -> int:
18-
if sys.platform == 'win32': # pragma: win32 cover
18+
fs_tracks_executable_bit = cmd_output(
19+
'git', 'config', 'core.fileMode', retcode=None,
20+
).strip()
21+
if fs_tracks_executable_bit == 'false': # pragma: win32 cover
1922
return _check_git_filemode(paths)
2023
else: # pragma: win32 no cover
2124
retv = 0

0 commit comments

Comments
 (0)