From 1533596b03ef07b07311821d90de3ef72abba5d6 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Thu, 8 Jul 2021 22:20:59 +0100 Subject: Mak EntryTup a froward ref --- git/index/fun.py | 11 +++++------ git/objects/fun.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'git') 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, ''): diff --git a/git/objects/fun.py b/git/objects/fun.py index fc49e389..4ff56fdd 100644 --- a/git/objects/fun.py +++ b/git/objects/fun.py @@ -16,7 +16,7 @@ if TYPE_CHECKING: from git import GitCmdObjectDB EntryTup = Tuple[bytes, int, str] # same as TreeCacheTup in tree.py - +EntryTupOrNone = Union[EntryTup, None] # --------------------------------------------------- -- cgit v1.2.1