File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1313 S_IFREG ,
1414)
1515import subprocess
16- from typing import List , Tuple , Union , cast
16+ from typing import List , Tuple , cast
1717
1818from git .cmd import PROC_CREATIONFLAGS , handle_process_output
1919from git .compat import (
@@ -168,13 +168,15 @@ def read_header(stream):
168168 return version , num_entries
169169
170170
171- def entry_key (* entry : Union [ Tuple [ BaseIndexEntry ], Tuple [PathLike , int ]]) :
171+ def entry_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- if len (* entry ) == 1 :
174+ if len (entry ) == 1 :
175175 entry_first = cast (BaseIndexEntry , entry [0 ]) # type: BaseIndexEntry
176176 return (entry_first .path , entry_first .stage )
177- return tuple (* entry )
177+ else :
178+ entry = cast (Tuple [PathLike , int ], tuple (entry ))
179+ return entry
178180 # END handle entry
179181
180182
You can’t perform that action at this time.
0 commit comments