Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ef81e1

Browse files
committed
Revert "Use NUL character to extract meta and path from git diff"
This reverts commit 01f0988.
1 parent cd8b9b2 commit 3ef81e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git/diff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,9 @@ def _index_from_patch_format(cls, repo: 'Repo', proc: Union['Popen', 'Git.AutoIn
509509
def _handle_diff_line(lines_bytes: bytes, repo: 'Repo', index: DiffIndex) -> None:
510510
lines = lines_bytes.decode(defenc)
511511

512-
it = iter(lines.split('\x00'))
513-
for meta, path in zip(it, it):
514-
meta = meta[1:]
512+
for line in lines.split(':')[1:]:
513+
meta, _, path = line.partition('\x00')
514+
path = path.rstrip('\x00')
515515
a_blob_id: Optional[str]
516516
b_blob_id: Optional[str]
517517
old_mode, new_mode, a_blob_id, b_blob_id, _change_type = meta.split(None, 4)

0 commit comments

Comments
 (0)