From dfbc0f42c7555b7145768774b861029c4283178c Mon Sep 17 00:00:00 2001 From: Yobmod Date: Thu, 8 Jul 2021 23:20:58 +0100 Subject: Fix traverse_trees_recursive() again --- git/objects/fun.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git') diff --git a/git/objects/fun.py b/git/objects/fun.py index 2abd7b09..cb323afb 100644 --- a/git/objects/fun.py +++ b/git/objects/fun.py @@ -144,7 +144,7 @@ def _to_full_path(item: EntryTupOrNone, path_prefix: str) -> EntryTupOrNone: def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[bytes, None]], - path_prefix: str) -> List[List[EntryTupOrNone]]: + path_prefix: str) -> List[tuple[EntryTupOrNone, ...]]: """ :return: list of list with entries according to the given binary tree-shas. The result is encoded in a list @@ -170,7 +170,7 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by trees_data.append(data) # END for each sha to get data for - out: List[List[EntryTupOrNone]] = [] + out: List[Tuple[EntryTupOrNone, ...]] = [] # find all matching entries and recursively process them together if the match # is a tree. If the match is a non-tree item, put it into the result. @@ -201,7 +201,7 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by out.extend(traverse_trees_recursive( odb, [((ei and ei[0]) or None) for ei in entries], path_prefix + name + '/')) else: - out.append([_to_full_path(e, path_prefix) for e in entries]) + out.append(tuple(_to_full_path(e, path_prefix) for e in entries)) # END handle recursion # finally mark it done -- cgit v1.2.1