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

Commit2fa9fb1

Browse files
committed
update types in types.py
1 parentacbd6ba commit2fa9fb1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎git/index/base.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ def write_tree(self) -> Tree:
572572
# note: additional deserialization could be saved if write_tree_from_cache
573573
# would return sorted tree entries
574574
root_tree=Tree(self.repo,binsha,path='')
575-
root_tree._cache=tree_items# type: ignore # should this be encoded to [bytes, int, str]?
575+
root_tree._cache=tree_items
576576
returnroot_tree
577577

578578
def_process_diff_args(self,# type: ignore[override]
@@ -586,8 +586,9 @@ def _process_diff_args(self, # type: ignore[override]
586586
returnargs
587587

588588
def_to_relative_path(self,path:PathLike)->PathLike:
589-
""":return: Version of path relative to our git directory or raise ValueError
590-
if it is not within our git direcotory"""
589+
"""
590+
:return: Version of path relative to our git directory or raise ValueError
591+
if it is not within our git direcotory"""
591592
ifnotosp.isabs(path):
592593
returnpath
593594
ifself.repo.bare:

‎git/types.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
fromtypingimport (Callable,Dict,NoReturn,Sequence,Tuple,Union,Any,Iterator,# noqa: F401
88
NamedTuple,TYPE_CHECKING,TypeVar)# noqa: F401
99

10-
ifTYPE_CHECKING:
11-
fromgit.repoimportRepo
12-
1310
ifsys.version_info[:2]>= (3,8):
1411
fromtypingimportFinal,Literal,SupportsIndex,TypedDict,Protocol,runtime_checkable# noqa: F401
1512
else:
@@ -28,6 +25,7 @@
2825
PathLike=Union[str,'os.PathLike[str]']# forward ref as pylance complains unless editing with py3.9+
2926

3027
ifTYPE_CHECKING:
28+
fromgit.repoimportRepo
3129
fromgit.objectsimportCommit,Tree,TagObject,Blob
3230
# from git.refs import SymbolicReference
3331

@@ -36,6 +34,7 @@
3634

3735
Tree_ish=Union['Commit','Tree']
3836
Commit_ish=Union['Commit','TagObject','Blob','Tree']
37+
Lit_commit_ish=Literal['commit','tag','blob','tree']
3938

4039
# Config_levels ---------------------------------------------------------
4140

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp