simplify link url
This commit is contained in:
parent
e935635620
commit
c0744e5ba0
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue