summaryrefslogtreecommitdiff
path: root/git/objects/tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'git/objects/tree.py')
-rw-r--r--git/objects/tree.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/git/objects/tree.py b/git/objects/tree.py
index a9656c1d..0e3f44b9 100644
--- a/git/objects/tree.py
+++ b/git/objects/tree.py
@@ -24,7 +24,7 @@ from .fun import (
from typing import (Any, Callable, Dict, Iterable, Iterator, List,
Tuple, Type, Union, cast, TYPE_CHECKING)
-from git.types import PathLike, TypeGuard
+from git.types import PathLike, TypeGuard, Literal
if TYPE_CHECKING:
from git.repo import Repo
@@ -195,7 +195,7 @@ class Tree(IndexObject, git_diff.Diffable, util.Traversable, util.Serializable):
blob = tree[0]
"""
- type = "tree"
+ type: Literal['tree'] = "tree"
__slots__ = "_cache"
# actual integer ids for comparison
@@ -285,7 +285,7 @@ class Tree(IndexObject, git_diff.Diffable, util.Traversable, util.Serializable):
return [i for i in self if i.type == "tree"]
@ property
- def blobs(self) -> List['Blob']:
+ def blobs(self) -> List[Blob]:
""":return: list(Blob, ...) list of blobs directly below this tree"""
return [i for i in self if i.type == "blob"]
@@ -322,8 +322,8 @@ class Tree(IndexObject, git_diff.Diffable, util.Traversable, util.Serializable):
# assert is_tree_traversed(ret_tup), f"Type is {[type(x) for x in list(ret_tup[0])]}"
# return ret_tup[0]"""
return cast(Union[Iterator[IndexObjUnion], Iterator[TraversedTreeTup]],
- super(Tree, self).traverse(predicate, prune, depth, # type: ignore
- branch_first, visit_once, ignore_self))
+ super(Tree, self)._traverse(predicate, prune, depth, # type: ignore
+ branch_first, visit_once, ignore_self))
def list_traverse(self, *args: Any, **kwargs: Any) -> IterableList[IndexObjUnion]:
"""
@@ -331,7 +331,7 @@ class Tree(IndexObject, git_diff.Diffable, util.Traversable, util.Serializable):
traverse()
Tree -> IterableList[Union['Submodule', 'Tree', 'Blob']]
"""
- return super(Tree, self).list_traverse(* args, **kwargs)
+ return super(Tree, self)._list_traverse(* args, **kwargs)
# List protocol