#184: small refactoring according to Alexander's comment, added comments

This commit is contained in:
Vokhmin Alexey V 2013-06-14 14:17:30 +04:00
parent e36a0386a2
commit 52621ad5dc
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,9 @@ 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
return nil unless url = node.url(treeish)
# - empty string if ".gitmodules" does not exist
url = node.url(treeish)
return nil if url.blank?
url.gsub!(/.git$/, '')
if url =~ /^git:/
url.gsub!(/^git/, 'http')