| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -572,7 +572,7 @@ def write_tree(self) -> Tree: | |||
| 572 | 572 | # note: additional deserialization could be saved if write_tree_from_cache | |
| 573 | 573 | # would return sorted tree entries | |
| 574 | 574 | root_tree = Tree(self.repo, binsha, path='') | |
| 575 | - root_tree._cache = tree_items # type: ignore | ||
| 575 | + root_tree._cache = tree_items # type: ignore # should this be encoded to [bytes, int, str]? | ||
| 576 | 576 | return root_tree | |
| 577 | 577 | ||
| 578 | 578 | def _process_diff_args(self, # type: ignore[override] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments