mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
don't crash on cygwin mismatch check
This commit is contained in:
parent
6c6294571a
commit
8cfe8e590d
1 changed files with 4 additions and 1 deletions
|
|
@ -201,7 +201,10 @@ def check_for_cygwin_mismatch() -> None:
|
|||
"""See https://github.com/pre-commit/pre-commit/issues/354"""
|
||||
if sys.platform in ('cygwin', 'win32'): # pragma: no cover (windows)
|
||||
is_cygwin_python = sys.platform == 'cygwin'
|
||||
try:
|
||||
toplevel = get_root()
|
||||
except FatalError: # skip the check if we're not in a git repo
|
||||
return
|
||||
is_cygwin_git = toplevel.startswith('/')
|
||||
|
||||
if is_cygwin_python ^ is_cygwin_git:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue