diff --git a/app/helpers/git_helper.rb b/app/helpers/git_helper.rb index 6cfaf5244..9a9ecb90f 100644 --- a/app/helpers/git_helper.rb +++ b/app/helpers/git_helper.rb @@ -5,7 +5,8 @@ module GitHelper # node.url(treeish) looks like: # - http://0.0.0.0:3000/abf/git@abf.rosalinux.ru:abf/rhel-scripts.git # - git://github.com/avokhmin/mdv-scripts.git - url = node.url(treeish).gsub(/.git$/, '') + return nil unless url = node.url(treeish) + url.gsub!(/.git$/, '') if url =~ /^git:/ url.gsub!(/^git/, 'http') elsif str = /git@.*:.*/.match(url) diff --git a/app/views/projects/git/trees/_show.html.haml b/app/views/projects/git/trees/_show.html.haml index 4e7571e91..90d2a6afb 100644 --- a/app/views/projects/git/trees/_show.html.haml +++ b/app/views/projects/git/trees/_show.html.haml @@ -26,10 +26,12 @@ - if node.is_a? Grit::Submodule .pic= image_tag 'folder-submodule.png' .name - - url = submodule_url node, @treeish - = link_to(node.name, url, :class => 'files-see') - = '@' - = link_to(node.id[0..6], "#{url}/tree/#{node.id}", :class => 'files-see') + - if url = submodule_url(node, @treeish) + = link_to(node.name, url, :class => 'files-see') + = '@' + = link_to(node.id[0..6], "#{url}/tree/#{node.id}", :class => 'files-see') + - else + = "#{node.name} @ #{node.id[0..6]}" - else - options = [@project, @treeish, node_path] - if node.is_a?(Grit::Tree)