Commit dee11dadad88ed83300c7684aab52e5508f29f24

Authored by Dmitriy Zaporozhets
1 parent 8b6a14b5

Fix submodules

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 8 additions and 5 deletions   Show diff stats
app/helpers/submodule_helper.rb
... ... @@ -3,7 +3,10 @@ module SubmoduleHelper
3 3  
4 4 # links to files listing for submodule if submodule is a project on this server
5 5 def submodule_links(submodule_item)
6   - url = submodule_item.submodule_url
  6 + submodule = @repository.submodules(@ref)[submodule_item.path]
  7 +
  8 + url = submodule['url'] if submodule
  9 +
7 10 return url, nil unless url =~ /([^\/:]+\/[^\/]+\.git)\Z/
8 11  
9 12 project = $1
... ... @@ -19,7 +22,7 @@ module SubmoduleHelper
19 22 return url, nil
20 23 end
21 24 end
22   -
  25 +
23 26 protected
24 27  
25 28 def github_dot_com_url?(url)
... ... @@ -29,14 +32,14 @@ module SubmoduleHelper
29 32 def gitlab_dot_com_url?(url)
30 33 url =~ /gitlab\.com[\/:][^\/]+\/[^\/]+\Z/
31 34 end
32   -
  35 +
33 36 def self_url?(url, project)
34 37 return true if url == [ Gitlab.config.gitlab.url, '/', project, '.git' ].join('')
35 38 url == gitlab_shell.url_to_repo(project)
36 39 end
37   -
  40 +
38 41 def standard_links(host, project, commit)
39 42 base = [ 'https://', host, '/', project ].join('')
40 43 return base, [ base, '/tree/', commit ].join('')
41 44 end
42   -end
43 45 \ No newline at end of file
  46 +end
... ...