From 3ef81e182fcd3fca3f83216cf81d92d08c19cf5e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 7 Jan 2022 09:57:33 +0800 Subject: [PATCH] Revert "Use NUL character to extract meta and path from git diff" This reverts commit 01f09888208341876d1480bd22dc8f4107c100f1. --- git/diff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git/diff.py b/git/diff.py index c8c57685b..cea66d7ee 100644 --- a/git/diff.py +++ b/git/diff.py @@ -509,9 +509,9 @@ def _index_from_patch_format(cls, repo: 'Repo', proc: Union['Popen', 'Git.AutoIn def _handle_diff_line(lines_bytes: bytes, repo: 'Repo', index: DiffIndex) -> None: lines = lines_bytes.decode(defenc) - it = iter(lines.split('\x00')) - for meta, path in zip(it, it): - meta = meta[1:] + for line in lines.split(':')[1:]: + meta, _, path = line.partition('\x00') + path = path.rstrip('\x00') a_blob_id: Optional[str] b_blob_id: Optional[str] old_mode, new_mode, a_blob_id, b_blob_id, _change_type = meta.split(None, 4)