mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-11 13:44:17 +00: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:
commit
0a88f14e07
1 changed files with 4 additions and 1 deletions
|
|
@ -15,7 +15,10 @@ EXECUTABLE_VALUES = frozenset(('1', '3', '5', '7'))
|
||||||
|
|
||||||
|
|
||||||
def check_executables(paths: list[str]) -> int:
|
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)
|
return _check_git_filemode(paths)
|
||||||
else: # pragma: win32 no cover
|
else: # pragma: win32 no cover
|
||||||
retv = 0
|
retv = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue