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:
Anthony Sottile 2022-05-26 09:49:49 -04:00 committed by GitHub
commit 0a88f14e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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