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

Commitc3f91bd

Browse files
committed
Add initial types to IndexFile .init() to _to_relative_path()
1 parent4dff200 commitc3f91bd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎git/index/fun.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
S_IFREG,
1414
)
1515
importsubprocess
16-
fromtypingimportList,Tuple,Union,cast
16+
fromtypingimportList,Tuple,cast
1717

1818
fromgit.cmdimportPROC_CREATIONFLAGS,handle_process_output
1919
fromgit.compatimport (
@@ -168,13 +168,15 @@ def read_header(stream):
168168
returnversion,num_entries
169169

170170

171-
defentry_key(*entry:Union[Tuple[BaseIndexEntry],Tuple[PathLike,int]]):
171+
defentry_key(*entry)->Tuple[PathLike,int]:
172172
""":return: Key suitable to be used for the index.entries dictionary
173173
:param entry: One instance of type BaseIndexEntry or the path and the stage"""
174-
iflen(*entry)==1:
174+
iflen(entry)==1:
175175
entry_first=cast(BaseIndexEntry,entry[0])# type: BaseIndexEntry
176176
return (entry_first.path,entry_first.stage)
177-
returntuple(*entry)
177+
else:
178+
entry=cast(Tuple[PathLike,int],tuple(entry))
179+
returnentry
178180
# END handle entry
179181

180182

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp