diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-09 23:21:16 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-09 23:21:16 +0100 |
commit | 2ea528e9fbcac850d99ce527ad4a5e4afb3587a8 (patch) | |
tree | 1d53c6eca9f34d9356d59f348c4cb29cc28e66f4 /git/index/fun.py | |
parent | 09053c565915d114384b1c20af8eecfed98c8069 (diff) | |
download | gitpython-2ea528e9fbcac850d99ce527ad4a5e4afb3587a8.tar.gz |
Fix typing of index.fun.write_tree_from_cache()
Diffstat (limited to 'git/index/fun.py')
-rw-r--r-- | git/index/fun.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/git/index/fun.py b/git/index/fun.py index 45785687..96833a7a 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -249,7 +249,7 @@ def read_cache(stream: IO[bytes]) -> Tuple[int, Dict[Tuple[PathLike, int], 'Inde def write_tree_from_cache(entries: List[IndexEntry], odb, sl: slice, si: int = 0 - ) -> Tuple[bytes, List[Tuple[str, int, str]]]: + ) -> Tuple[bytes, List[Tuple[bytes, int, str]]]: """Create a tree from the given sorted list of entries and put the respective trees into the given object database @@ -298,12 +298,11 @@ def write_tree_from_cache(entries: List[IndexEntry], odb, sl: slice, si: int = 0 # finally create the tree sio = BytesIO() - tree_to_stream(tree_items, sio.write) # converts bytes of each item[0] to str - tree_items_stringified = cast(List[Tuple[str, int, str]], tree_items) + tree_to_stream(tree_items, sio.write) # writes to stream as bytes, but doesnt change tree_items sio.seek(0) istream = odb.store(IStream(str_tree_type, len(sio.getvalue()), sio)) - return (istream.binsha, tree_items_stringified) + return (istream.binsha, tree_items) def _tree_entry_to_baseindexentry(tree_entry: Tuple[bytes, int, str], stage: int) -> BaseIndexEntry: |