diff options
| -rw-r--r-- | git/index/fun.py | 11 | ||||
| -rw-r--r-- | git/objects/fun.py | 2 |
2 files changed, 6 insertions, 7 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, ''): 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] # --------------------------------------------------- |
