We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c62945 commit 8cfe8e5Copy full SHA for 8cfe8e5
1 file changed
pre_commit/git.py
@@ -201,7 +201,10 @@ def check_for_cygwin_mismatch() -> None:
201
"""See https://github.com/pre-commit/pre-commit/issues/354"""
202
if sys.platform in ('cygwin', 'win32'): # pragma: no cover (windows)
203
is_cygwin_python = sys.platform == 'cygwin'
204
- toplevel = get_root()
+ try:
205
+ toplevel = get_root()
206
+ except FatalError: # skip the check if we're not in a git repo
207
+ return
208
is_cygwin_git = toplevel.startswith('/')
209
210
if is_cygwin_python ^ is_cygwin_git:
0 commit comments