diff options
author | Timm Drevensek <abubadabu@gmail.com> | 2014-02-28 17:22:07 +0100 |
---|---|---|
committer | Timm Drevensek <abubadabu@gmail.com> | 2014-02-28 17:22:07 +0100 |
commit | c0744e5ba07a16475b014b976664c729c59516b7 (patch) | |
tree | b175f6de4aea265d98add62b2a55354ff61f47a5 /app/helpers/submodule_helper.rb | |
parent | e935635620cbc4a3f2f18303f12891cc997f1cb1 (diff) | |
download | gitlab-ce-c0744e5ba07a16475b014b976664c729c59516b7.tar.gz |
simplify link url
Diffstat (limited to 'app/helpers/submodule_helper.rb')
-rwxr-xr-x | app/helpers/submodule_helper.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb index d7a253fac89..09e5c08e621 100755 --- a/app/helpers/submodule_helper.rb +++ b/app/helpers/submodule_helper.rb @@ -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 |