File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 13
13
S_IFREG ,
14
14
)
15
15
import subprocess
16
- from typing import List , Tuple , Union , cast
16
+ from typing import List , Tuple , cast
17
17
18
18
from git .cmd import PROC_CREATIONFLAGS , handle_process_output
19
19
from git .compat import (
@@ -168,13 +168,15 @@ def read_header(stream):
168
168
return version , num_entries
169
169
170
170
171
- def entry_key (* entry : Union [ Tuple [ BaseIndexEntry ], Tuple [PathLike , int ]]) :
171
+ def entry_key (* entry ) -> Tuple [PathLike , int ]:
172
172
""":return: Key suitable to be used for the index.entries dictionary
173
173
:param entry: One instance of type BaseIndexEntry or the path and the stage"""
174
- if len (* entry ) == 1 :
174
+ if len (entry ) == 1 :
175
175
entry_first = cast (BaseIndexEntry , entry [0 ]) # type: BaseIndexEntry
176
176
return (entry_first .path , entry_first .stage )
177
- return tuple (* entry )
177
+ else :
178
+ entry = cast (Tuple [PathLike , int ], tuple (entry ))
179
+ return entry
178
180
# END handle entry
179
181
180
182
You can’t perform that action at this time.
0 commit comments