Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42e10c0

Browse files
committed
Fix new mypy error in is_cygwin_git
This fixes the second new mypy error that arose due to the changein88557bc. (7204c13 before this fixed the first of them.)
1 parent7204c13 commit42e10c0

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

‎git/util.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -448,25 +448,7 @@ def decygpath(path: PathLike) -> str:
448448
_is_cygwin_cache:Dict[str,Optional[bool]]= {}
449449

450450

451-
@overload
452-
defis_cygwin_git(git_executable:None)->Literal[False]:
453-
...
454-
455-
456-
@overload
457-
defis_cygwin_git(git_executable:PathLike)->bool:
458-
...
459-
460-
461-
defis_cygwin_git(git_executable:Union[None,PathLike])->bool:
462-
ifsys.platform=="win32":
463-
# This is Windows-native Python, since Cygwin has sys.platform == "cygwin".
464-
returnFalse
465-
466-
ifgit_executableisNone:
467-
returnFalse
468-
469-
git_executable=str(git_executable)
451+
def_is_cygwin_git(git_executable:str)->bool:
470452
is_cygwin=_is_cygwin_cache.get(git_executable)# type: Optional[bool]
471453
ifis_cygwinisNone:
472454
is_cygwin=False
@@ -489,6 +471,25 @@ def is_cygwin_git(git_executable: Union[None, PathLike]) -> bool:
489471
returnis_cygwin
490472

491473

474+
@overload
475+
defis_cygwin_git(git_executable:None)->Literal[False]:
476+
...
477+
478+
479+
@overload
480+
defis_cygwin_git(git_executable:PathLike)->bool:
481+
...
482+
483+
484+
defis_cygwin_git(git_executable:Union[None,PathLike])->bool:
485+
ifsys.platform=="win32":# TODO: See if we can use `sys.platform != "cygwin"`.
486+
returnFalse
487+
elifgit_executableisNone:
488+
returnFalse
489+
else:
490+
return_is_cygwin_git(str(git_executable))
491+
492+
492493
defget_user_id()->str:
493494
""":return: String identifying the currently active system user as ``name@node``"""
494495
return"%s@%s"% (getpass.getuser(),platform.node())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp