diff options
| author | Yobmod <yobmod@gmail.com> | 2021-07-08 23:49:01 +0100 |
|---|---|---|
| committer | Yobmod <yobmod@gmail.com> | 2021-07-08 23:49:01 +0100 |
| commit | 4f13b4e23526616f307370dc9a869b067e90b276 (patch) | |
| tree | e389bba12640d5f1281a64167b6fc7c6ed9a198e /git/objects/fun.py | |
| parent | c27d2b078b515a8321b3f7f7abdcea363d8049df (diff) | |
| download | gitpython-4f13b4e23526616f307370dc9a869b067e90b276.tar.gz | |
fix base,ours,theirs typing
Diffstat (limited to 'git/objects/fun.py')
| -rw-r--r-- | git/objects/fun.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git/objects/fun.py b/git/objects/fun.py index 42954fc2..57cefcf2 100644 --- a/git/objects/fun.py +++ b/git/objects/fun.py @@ -102,13 +102,13 @@ def tree_entries_from_data(data: bytes) -> List[EntryTup]: return out -def _find_by_name(tree_data: Sequence[EntryTupOrNone], name: str, is_dir: bool, start_at: int +def _find_by_name(tree_data: List[EntryTupOrNone], name: str, is_dir: bool, start_at: int ) -> EntryTupOrNone: """return data entry matching the given name and tree mode or None. Before the item is returned, the respective data item is set None in the tree_data list to mark it done""" - tree_data_list: List[EntryTupOrNone] = list(tree_data) + tree_data_list: List[EntryTupOrNone] = tree_data try: item = tree_data_list[start_at] if item and item[2] == name and S_ISDIR(item[1]) == is_dir: @@ -160,6 +160,7 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by set it '' for the first iteration :note: The ordering of the returned items will be partially lost""" trees_data: List[List[EntryTupOrNone]] = [] + nt = len(tree_shas) for tree_sha in tree_shas: if tree_sha is None: @@ -193,8 +194,7 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by # ti+nt, not ti+1+nt for tio in range(ti + 1, ti + nt): tio = tio % nt - td = trees_data[tio] - entries[tio] = _find_by_name(td, name, is_dir, ii) + entries[tio] = _find_by_name(trees_data[tio], name, is_dir, ii) # END for each other item data # if we are a directory, enter recursion |
