Permalink
Browse files

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

  • Loading branch information...
1 parent bf8dd15 commit ca3944efc9b0484c33a81b386244e0bb487cd621 @jonashaag committed Jun 23, 2011
Showing with 5 additions and 3 deletions.
  1. +4 −2 diff.py
  2. +1 −1 templates/view_commit.html
View
@@ -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
})
@@ -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) }}">

0 comments on commit ca3944e

Please sign in to comment.