diff options
author | Yobmod <yobmod@gmail.com> | 2021-05-15 22:58:47 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-05-15 22:58:47 +0100 |
commit | 4dff2004308a7a1e5b9afc7a5b3b9cb515e12514 (patch) | |
tree | e6b61681ae98d18430d9955cd2e697e87e13dada /git/index/fun.py | |
parent | 96364599258e7e036298dd5737918bde346ec195 (diff) | |
download | gitpython-4dff2004308a7a1e5b9afc7a5b3b9cb515e12514.tar.gz |
Add initial types to IndexFile .init() to _to_relative_path()
Diffstat (limited to 'git/index/fun.py')
-rw-r--r-- | git/index/fun.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/index/fun.py b/git/index/fun.py index ea7a404b..85b85ed5 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -1,7 +1,7 @@ # Contains standalone functions to accompany the index implementation and make it # more versatile # NOTE: Autodoc hates it if this is a docstring -from git.types import PathLike, TBD +from git.types import PathLike from io import BytesIO import os from stat import ( @@ -168,13 +168,13 @@ def read_header(stream): return version, num_entries -def entry_key(entry: Union[Tuple[BaseIndexEntry], Tuple[PathLike, TBD]]): +def entry_key(*entry: Union[Tuple[BaseIndexEntry], Tuple[PathLike, int]]): """:return: Key suitable to be used for the index.entries dictionary :param entry: One instance of type BaseIndexEntry or the path and the stage""" - if len(entry) == 1: + if len(*entry) == 1: entry_first = cast(BaseIndexEntry, entry[0]) # type: BaseIndexEntry return (entry_first.path, entry_first.stage) - return tuple(entry) + return tuple(*entry) # END handle entry |