Changeset - 3ab8744d20c9
[Not reviewed]
default
0 1 0
Mads Kiilerich (mads) - 5 years ago 2021-02-22 10:56:04
mads@kiilerich.com
Grafted from: b3ba43b8c749
diffs: drop pointless check for "\ No newline at end of file"

Such lines would have been caught on '\' as "unknown command" by the command
check a few lines above.
1 file changed with 8 insertions and 9 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/diffs.py
Show inline comments
 
@@ -661,21 +661,20 @@ def _parse_lines(diff_lines):
 
                elif command == ' ':
 
                    affects_old = affects_new = True
 
                    action = 'unmod'
 
                else:
 
                    raise Exception('error parsing diff - unknown command in line %r at -%s+%s' % (line, old_line, new_line))
 

	
 
                if not _newline_marker.match(line):
 
                    old_line += affects_old
 
                    new_line += affects_new
 
                    lines.append({
 
                        'old_lineno':   affects_old and old_line or '',
 
                        'new_lineno':   affects_new and new_line or '',
 
                        'action':       action,
 
                        'line':         line[1:],
 
                    })
 
                old_line += affects_old
 
                new_line += affects_new
 
                lines.append({
 
                    'old_lineno':   affects_old and old_line or '',
 
                    'new_lineno':   affects_new and new_line or '',
 
                    'action':       action,
 
                    'line':         line[1:],
 
                })
 

	
 
                line = next(diff_lines)
 

	
 
                if _newline_marker.match(line):
 
                    # we need to append to lines, since this is not
 
                    # counted in the line specs of diff
0 comments (0 inline, 0 general)