Skip to content

Commit

Permalink
Remove a bit of old commented-out code in git.objects.*
Browse files Browse the repository at this point in the history
  • Loading branch information
EliahKagan committed Mar 18, 2024
1 parent 4e9a2f2 commit c58be4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions git/objects/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions git/objects/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
Any,
Callable,
Deque,
# Generic,
Iterator,
NamedTuple,
Sequence,
Expand All @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit c58be4c

Please sign in to comment.