Commit c0744e5b authored by Timm Drevensek's avatar Timm Drevensek

simplify link url

parent e9356356
...@@ -50,11 +50,10 @@ module SubmoduleHelper ...@@ -50,11 +50,10 @@ module SubmoduleHelper
def relative_self_links(url, commit) def relative_self_links(url, commit)
if url.scan(/(\.\.\/)/).size == 2 if url.scan(/(\.\.\/)/).size == 2
base = [ Gitlab.config.gitlab.url, '/', url[/.*\/(.*)\/.*\.git/, 1] ].join('') base = url[/([^\/]*\/[^\/]*)\.git/, 1]
else else
base = [ Gitlab.config.gitlab.url, '/', @project.group.path ].join('') base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('')
end end
base = [ base, '/', url[/.*\/(.*)\.git/, 1] ].join('') return project_path(base), project_tree_path(base, commit)
return base, [ base, '/tree/', commit ].join('')
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment