diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 31daf1b..22bdec9 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 5a7ef1f..f1e1766 100644 --- a/app/views/repositories/revision.rhtml +++ b/app/views/repositories/revision.rhtml @@ -49,7 +49,7 @@