summaryrefslogtreecommitdiff
path: root/git/index/fun.py
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-08 22:20:59 +0100
committerYobmod <yobmod@gmail.com>2021-07-08 22:20:59 +0100
commit1533596b03ef07b07311821d90de3ef72abba5d6 (patch)
tree2d2235ab642fe1aa7f63c1ed84ed0d56da8c9dbb /git/index/fun.py
parent9f88796704cc9f9826b1a25f322108f8dcc52ce6 (diff)
downloadgitpython-1533596b03ef07b07311821d90de3ef72abba5d6.tar.gz
Mak EntryTup a froward ref
Diffstat (limited to 'git/index/fun.py')
-rw-r--r--git/index/fun.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/git/index/fun.py b/git/index/fun.py
index 74f6efbf..382e3d44 100644
--- a/git/index/fun.py
+++ b/git/index/fun.py
@@ -57,7 +57,11 @@ from git.types import PathLike, TypeGuard
if TYPE_CHECKING:
from .base import IndexFile
- from git.objects.fun import EntryTup
+ from git.objects.fun import EntryTupOrNone
+
+
+def is_three_entry_list(inp) -> TypeGuard[List['EntryTupOrNone']]:
+ return isinstance(inp, list) and len(inp) == 3
# ------------------------------------------------------------------------------------
@@ -334,11 +338,6 @@ def aggressive_tree_merge(odb, tree_shas: Sequence[bytes]) -> List[BaseIndexEntr
if len(tree_shas) > 3:
raise ValueError("Cannot handle %i trees at once" % len(tree_shas))
- EntryTupOrNone = Union[EntryTup, None]
-
- def is_three_entry_list(inp) -> TypeGuard[List[EntryTupOrNone]]:
- return isinstance(inp, list) and len(inp) == 3
-
# three trees
for three_entries in traverse_trees_recursive(odb, tree_shas, ''):