mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Remove cygwin git mismatch message in MSYS2
This commit is contained in:
parent
8858e058b0
commit
88ccb3e75d
1 changed files with 3 additions and 1 deletions
|
|
@ -182,7 +182,9 @@ def check_for_cygwin_mismatch() -> None:
|
||||||
if sys.platform in ('cygwin', 'win32'): # pragma: no cover (windows)
|
if sys.platform in ('cygwin', 'win32'): # pragma: no cover (windows)
|
||||||
is_cygwin_python = sys.platform == 'cygwin'
|
is_cygwin_python = sys.platform == 'cygwin'
|
||||||
toplevel = cmd_output('git', 'rev-parse', '--show-toplevel')[1]
|
toplevel = cmd_output('git', 'rev-parse', '--show-toplevel')[1]
|
||||||
is_cygwin_git = toplevel.startswith('/')
|
git_exec_path = cmd_output('git', '--exec-path')[1].strip()
|
||||||
|
is_msys2_git = git_exec_path == '/usr/lib/git-core'
|
||||||
|
is_cygwin_git = toplevel.startswith('/') and not is_msys2_git
|
||||||
|
|
||||||
if is_cygwin_python ^ is_cygwin_git:
|
if is_cygwin_python ^ is_cygwin_git:
|
||||||
exe_type = {True: '(cygwin)', False: '(windows)'}
|
exe_type = {True: '(cygwin)', False: '(windows)'}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue