mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2025-08-26 18:10:18 +08:00
Merge pull request #730 from Kurt-von-Laven/support-git-file-mode-false
Check Git core.fileMode rather than infer from OS.
This commit is contained in:
@ -15,7 +15,10 @@ EXECUTABLE_VALUES = frozenset(('1', '3', '5', '7'))
|
||||
|
||||
|
||||
def check_executables(paths: list[str]) -> int:
|
||||
if sys.platform == 'win32': # pragma: win32 cover
|
||||
fs_tracks_executable_bit = cmd_output(
|
||||
'git', 'config', 'core.fileMode', retcode=None,
|
||||
).strip()
|
||||
if fs_tracks_executable_bit == 'false': # pragma: win32 cover
|
||||
return _check_git_filemode(paths)
|
||||
else: # pragma: win32 no cover
|
||||
retv = 0
|
||||
|
Reference in New Issue
Block a user