Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0bfe56e made the commit view display garbage for deleted files' names.

  • Loading branch information...
commit ca3944efc9b0484c33a81b386244e0bb487cd621 1 parent bf8dd15
@jonashaag authored
Showing with 5 additions and 3 deletions.
  1. +4 −2 diff.py
  2. +1 −1  templates/view_commit.html
View
6 diff.py
@@ -30,6 +30,8 @@ def __init__(self, udiff):
def _extract_rev(self, line1, line2):
def _extract(line):
parts = line.split(None, 1)
+ if parts[0].startswith(('a/', 'b/')):
+ parts[0] = parts[0][2:]
return parts[0], (len(parts) == 2 and parts[1] or None)
try:
if line1.startswith('--- ') and line2.startswith('+++ '):
@@ -92,9 +94,9 @@ def prepare(self, want_header=True):
old, new = self._extract_rev(line, lineiter.next())
files.append({
'is_header': False,
- 'old_filename': old[0][2:],
+ 'old_filename': old[0],
'old_revision': old[1],
- 'new_filename': new[0][2:],
+ 'new_filename': new[0],
'new_revision': new[1],
'chunks': chunks
})
View
2  templates/view_commit.html
@@ -26,7 +26,7 @@
{% if file.old_filename != file.new_filename %}
{{ file.old_filename }} →
{% endif %}#}
- {% if file.new_filename == 'dev/null' %}
+ {% if file.new_filename == '/dev/null' %}
<del>{{ file.old_filename|u }}</del>
{% else %}
<a href="{{ build_url('view_blob', repo=repo.name, commit_id=commit_id, path=file.new_filename) }}">
Please sign in to comment.
Something went wrong with that request. Please try again.