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)
<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>