From c58be4c0b6e82dc1c0445f9e41e53263f5d2ec4e Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Mon, 18 Mar 2024 15:44:52 -0400 Subject: [PATCH] Remove a bit of old commented-out code in git.objects.* --- git/objects/tree.py | 4 ---- git/objects/util.py | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/git/objects/tree.py b/git/objects/tree.py index 18ccf2f30..d8320b319 100644 --- a/git/objects/tree.py +++ b/git/objects/tree.py @@ -48,9 +48,6 @@ TraversedTreeTup = Union[Tuple[Union["Tree", None], IndexObjUnion, Tuple["Submodule", "Submodule"]]] -# def is_tree_cache(inp: Tuple[bytes, int, str]) -> TypeGuard[TreeCacheTup]: -# return isinstance(inp[0], bytes) and isinstance(inp[1], int) and isinstance([inp], str) - # -------------------------------------------------------- cmp: Callable[[str, str], int] = lambda a, b: (a > b) - (a < b) @@ -124,7 +121,6 @@ def add(self, sha: bytes, mode: int, name: str, force: bool = False) -> "TreeMod index = self._index_by_name(name) item = (sha, mode, name) - # assert is_tree_cache(item) if index == -1: self._cache.append(item) diff --git a/git/objects/util.py b/git/objects/util.py index 6f6927b47..9491b067c 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -36,7 +36,6 @@ Any, Callable, Deque, - # Generic, Iterator, NamedTuple, Sequence, @@ -49,7 +48,7 @@ overload, ) -from git.types import Has_id_attribute, Literal # , _T +from git.types import Has_id_attribute, Literal if TYPE_CHECKING: from io import BytesIO, StringIO @@ -63,7 +62,6 @@ from .tag import TagObject from .tree import TraversedTreeTup, Tree else: - # Protocol = Generic[_T] # Needed for typing bug #572? Protocol = ABC def runtime_checkable(f):