Commit c0744e5b authored by abubadabu's avatar abubadabu

simplify link url

parent e9356356
......@@ -50,11 +50,10 @@ module SubmoduleHelper
def relative_self_links(url, commit)
if url.scan(/(\.\.\/)/).size == 2
base = [ Gitlab.config.gitlab.url, '/', url[/.*\/(.*)\/.*\.git/, 1] ].join('')
base = url[/([^\/]*\/[^\/]*)\.git/, 1]
else
base = [ Gitlab.config.gitlab.url, '/', @project.group.path ].join('')
base = [ @project.group.path, '/', url[/([^\/]*)\.git/, 1] ].join('')
end
base = [ base, '/', url[/.*\/(.*)\.git/, 1] ].join('')
return base, [ base, '/tree/', commit ].join('')
return project_path(base), project_tree_path(base, commit)
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