@@ -249,7 +249,7 @@ def read_cache(stream: IO[bytes]) -> Tuple[int, Dict[Tuple[PathLike, int], 'Inde
249
249
250
250
251
251
def write_tree_from_cache (entries : List [IndexEntry ], odb , sl : slice , si : int = 0
252
- ) -> Tuple [bytes , List [Tuple [str , int , str ]]]:
252
+ ) -> Tuple [bytes , List [Tuple [bytes , int , str ]]]:
253
253
"""Create a tree from the given sorted list of entries and put the respective
254
254
trees into the given object database
255
255
@@ -298,12 +298,11 @@ def write_tree_from_cache(entries: List[IndexEntry], odb, sl: slice, si: int = 0
298
298
299
299
# finally create the tree
300
300
sio = BytesIO ()
301
- tree_to_stream (tree_items , sio .write ) # converts bytes of each item[0] to str
302
- tree_items_stringified = cast (List [Tuple [str , int , str ]], tree_items )
301
+ tree_to_stream (tree_items , sio .write ) # writes to stream as bytes, but doesnt change tree_items
303
302
sio .seek (0 )
304
303
305
304
istream = odb .store (IStream (str_tree_type , len (sio .getvalue ()), sio ))
306
- return (istream .binsha , tree_items_stringified )
305
+ return (istream .binsha , tree_items )
307
306
308
307
309
308
def _tree_entry_to_baseindexentry (tree_entry : Tuple [bytes , int , str ], stage : int ) -> BaseIndexEntry :
0 commit comments