From 2767e0d47b83234508108f34b5e11d804abf4d58 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 19 2016 22:08:25 +0000 Subject: Let's remove the ending < or > when viewing a commit --- diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index bdd8966..d9201fe 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -294,13 +294,16 @@ def patch_to_diff(patch): hunk.old_start, hunk.old_lines, hunk.new_start, hunk.new_lines) for line in hunk.lines: if hasattr(line, 'content'): - content = content + line.origin + ' '+ line.content + origin = line.origin + if line.origin in ['<', '>']: + origin = '' + content = content + origin + ' '+ line.content else: # Avoid situation where at the end of a file we get: # + foo< # \ No newline at end of file if line[0] == '<': - line = ('',line[1]) + line = ('', line[1]) content = content + ' '.join(line) return content