Fix unicode regression regressions
8377e0a went a bit too far and removed some code that was necessary for 3.4 but broke some utf-8 in git commits. This restores most of what that removed, with one change that causes it to work with the test commits listed at the top of the file. Change-Id: Id39d7799f9c210a0ff0a80aeef34681eb6fe5770
This commit is contained in:
parent
fbb9969033
commit
8575905669
@ -413,7 +413,11 @@ class Repo(object):
|
|||||||
oldchunk = []
|
oldchunk = []
|
||||||
newchunk = []
|
newchunk = []
|
||||||
prev_key = ''
|
prev_key = ''
|
||||||
diff_lines = diff_context.diff.split('\n')
|
if isinstance(diff_context.diff, six.string_types):
|
||||||
|
diff_text = diff_context.diff
|
||||||
|
else:
|
||||||
|
diff_text = diff_context.diff.decode('utf-8')
|
||||||
|
diff_lines = diff_text.split('\n')
|
||||||
for i, line in enumerate(diff_lines):
|
for i, line in enumerate(diff_lines):
|
||||||
last_line = (i == len(diff_lines)-1)
|
last_line = (i == len(diff_lines)-1)
|
||||||
if line.startswith('---'):
|
if line.startswith('---'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user