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:
James E. Blair 2016-02-10 07:52:34 -08:00
parent fbb9969033
commit 8575905669
1 changed files with 5 additions and 1 deletions

View File

@ -413,7 +413,11 @@ class Repo(object):
oldchunk = []
newchunk = []
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):
last_line = (i == len(diff_lines)-1)
if line.startswith('---'):