summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/repositories_helper.rb7
-rw-r--r--app/views/repositories/revision.rhtml2
2 files changed, 6 insertions, 3 deletions
diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb
index 31daf1bd8..22bdec9df 100644
--- a/app/helpers/repositories_helper.rb
+++ b/app/helpers/repositories_helper.rb
@@ -58,8 +58,11 @@ module RepositoriesHelper
end
def with_leading_slash(path)
- path ||= ''
- path.starts_with?('/') ? path : "/#{path}"
+ path.to_s.starts_with?('/') ? path : "/#{path}"
+ end
+
+ def without_leading_slash(path)
+ path.gsub(%r{^/+}, '')
end
def subversion_field_tags(form, repository)
diff --git a/app/views/repositories/revision.rhtml b/app/views/repositories/revision.rhtml
index 5a7ef1fd5..f1e176669 100644
--- a/app/views/repositories/revision.rhtml
+++ b/app/views/repositories/revision.rhtml
@@ -49,7 +49,7 @@
<td><div class="square action_<%= change.action %>"></div> <%= change.path %> <%= "(#{change.revision})" unless change.revision.blank? %></td>
<td align="right">
<% if change.action == "M" %>
-<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => change.path, :rev => @changeset.revision %>
+<%= link_to l(:label_view_diff), :action => 'diff', :id => @project, :path => without_leading_slash(change.path), :rev => @changeset.revision %>
<% end %>
</td>
</tr>