summaryrefslogtreecommitdiff
path: root/git/index/base.py
diff options
context:
space:
mode:
authorDominic <yobmod@gmail.com>2021-08-03 16:40:48 +0100
committerGitHub <noreply@github.com>2021-08-03 16:40:48 +0100
commitfe54118ec07a68d5dc6f6108510cffc55dfca643 (patch)
tree3025974ca54ef607ee3d4660da4dc242e184f8ea /git/index/base.py
parentd8a639865d02a6bb3f93a233d3caa928d18bc622 (diff)
parent84232f7c71e41e56636f203eb26763a03ab6e945 (diff)
downloadgitpython-fe54118ec07a68d5dc6f6108510cffc55dfca643.tar.gz
Merge pull request #1311 from Yobmod/main
Drop 3.6, increase type strictness
Diffstat (limited to 'git/index/base.py')
-rw-r--r--git/index/base.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/git/index/base.py b/git/index/base.py
index 6452419c..102703e6 100644
--- a/git/index/base.py
+++ b/git/index/base.py
@@ -70,7 +70,7 @@ from .util import (
from typing import (Any, BinaryIO, Callable, Dict, IO, Iterable, Iterator, List, NoReturn,
Sequence, TYPE_CHECKING, Tuple, Type, Union)
-from git.types import Commit_ish, PathLike, TBD
+from git.types import Commit_ish, PathLike
if TYPE_CHECKING:
from subprocess import Popen
@@ -181,7 +181,7 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
self.version, self.entries, self._extension_data, _conten_sha = read_cache(stream)
return self
- def _entries_sorted(self) -> List[TBD]:
+ def _entries_sorted(self) -> List[IndexEntry]:
""":return: list of entries, in a sorted fashion, first by path, then by stage"""
return sorted(self.entries.values(), key=lambda e: (e.path, e.stage))
@@ -427,8 +427,8 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
# END path exception handling
# END for each path
- def _write_path_to_stdin(self, proc: 'Popen', filepath: PathLike, item: TBD, fmakeexc: Callable[..., GitError],
- fprogress: Callable[[PathLike, bool, TBD], None],
+ def _write_path_to_stdin(self, proc: 'Popen', filepath: PathLike, item: PathLike, fmakeexc: Callable[..., GitError],
+ fprogress: Callable[[PathLike, bool, PathLike], None],
read_from_stdout: bool = True) -> Union[None, str]:
"""Write path to proc.stdin and make sure it processes the item, including progress.
@@ -492,12 +492,13 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
are at stage 3 will not have a stage 3 entry.
"""
is_unmerged_blob = lambda t: t[0] != 0
- path_map: Dict[PathLike, List[Tuple[TBD, Blob]]] = {}
+ path_map: Dict[PathLike, List[Tuple[StageType, Blob]]] = {}
for stage, blob in self.iter_blobs(is_unmerged_blob):
path_map.setdefault(blob.path, []).append((stage, blob))
# END for each unmerged blob
for line in path_map.values():
line.sort()
+
return path_map
@ classmethod
@@ -1201,7 +1202,6 @@ class IndexFile(LazyMixin, git_diff.Diffable, Serializable):
handle_stderr(proc, checked_out_files)
return checked_out_files
# END paths handling
- assert "Should not reach this point"
@ default_index
def reset(self, commit: Union[Commit, 'Reference', str] = 'HEAD', working_tree: bool = False,