Skip to content

Commit 90a6e1c

Browse files
committed
Add '-z' on top of '--raw' to avoid path name mangling
Authored based on #1099 (comment) Fixes #1099
1 parent 696e4ed commit 90a6e1c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git/diff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def diff(self, other=Index, paths=None, create_patch=False, **kwargs):
108108
args.append("-p")
109109
else:
110110
args.append("--raw")
111+
args.append("-z")
111112

112113
# in any way, assure we don't see colored output,
113114
# fixes https://github.com/gitpython-developers/GitPython/issues/172
@@ -483,7 +484,7 @@ def handle_diff_line(line):
483484
if not line.startswith(":"):
484485
return
485486

486-
meta, _, path = line[1:].partition('\t')
487+
meta, _, path = line[1:].partition('\x00')
487488
old_mode, new_mode, a_blob_id, b_blob_id, _change_type = meta.split(None, 4)
488489
# Change type can be R100
489490
# R: status letter

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy