Skip to content

Commit 1533596

Browse files
committed
Mak EntryTup a froward ref
1 parent 9f88796 commit 1533596

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

git/index/fun.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@
5757

5858
if TYPE_CHECKING:
5959
from .base import IndexFile
60-
from git.objects.fun import EntryTup
60+
from git.objects.fun import EntryTupOrNone
61+
62+
63+
def is_three_entry_list(inp) -> TypeGuard[List['EntryTupOrNone']]:
64+
return isinstance(inp, list) and len(inp) == 3
6165

6266
# ------------------------------------------------------------------------------------
6367

@@ -334,11 +338,6 @@ def aggressive_tree_merge(odb, tree_shas: Sequence[bytes]) -> List[BaseIndexEntr
334338
if len(tree_shas) > 3:
335339
raise ValueError("Cannot handle %i trees at once" % len(tree_shas))
336340

337-
EntryTupOrNone = Union[EntryTup, None]
338-
339-
def is_three_entry_list(inp) -> TypeGuard[List[EntryTupOrNone]]:
340-
return isinstance(inp, list) and len(inp) == 3
341-
342341
# three trees
343342
for three_entries in traverse_trees_recursive(odb, tree_shas, ''):
344343

git/objects/fun.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from git import GitCmdObjectDB
1717

1818
EntryTup = Tuple[bytes, int, str] # same as TreeCacheTup in tree.py
19-
19+
EntryTupOrNone = Union[EntryTup, None]
2020

2121
# ---------------------------------------------------
2222

0 commit comments

Comments
 (0)