summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2022-01-07 09:57:33 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2022-01-07 09:57:33 +0800
commit3ef81e182fcd3fca3f83216cf81d92d08c19cf5e (patch)
tree9d48b686e75d8d9487d191f42acfea71df16cfde
parentcd8b9b2fd875b5040b1ca9f0c8f5acaffe70ab7f (diff)
downloadgitpython-3ef81e182fcd3fca3f83216cf81d92d08c19cf5e.tar.gz
Revert "Use NUL character to extract meta and path from git diff"
This reverts commit 01f09888208341876d1480bd22dc8f4107c100f1.
-rw-r--r--git/diff.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/git/diff.py b/git/diff.py
index c8c57685..cea66d7e 100644
--- a/git/diff.py
+++ b/git/diff.py
@@ -509,9 +509,9 @@ class Diff(object):
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)