Skip to content

Commit 4dff200

Browse files
committed
Add initial types to IndexFile .init() to _to_relative_path()
1 parent 9636459 commit 4dff200

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎git/index/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ def unmerged_blobs(self) -> Dict[PathLike, List[Tuple[StageType, Blob]]]:
490490
return path_map
491491

492492
@classmethod
493-
def entry_key(cls, entry: Union[Tuple[BaseIndexEntry], Tuple[PathLike, StageType]]) -> Tuple[PathLike, StageType]:
494-
return entry_key(entry)
493+
def entry_key(cls, *entry: Union[Tuple[BaseIndexEntry], Tuple[PathLike, StageType]]) -> Tuple[PathLike, StageType]:
494+
return entry_key(*entry)
495495

496496
def resolve_blobs(self, iter_blobs: Iterator[Blob]) -> 'IndexFile':
497497
"""Resolve the blobs given in blob iterator. This will effectively remove the

‎git/index/fun.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contains standalone functions to accompany the index implementation and make it
22
# more versatile
33
# NOTE: Autodoc hates it if this is a docstring
4-
from git.types import PathLike, TBD
4+
from git.types import PathLike
55
from io import BytesIO
66
import os
77
from stat import (
@@ -168,13 +168,13 @@ def read_header(stream):
168168
return version, num_entries
169169

170170

171-
def entry_key(entry: Union[Tuple[BaseIndexEntry], Tuple[PathLike, TBD]]):
171+
def entry_key(*entry: Union[Tuple[BaseIndexEntry], 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+
return tuple(*entry)
178178
# END handle entry
179179

180180

0 commit comments

Comments
 (0)