From 52621ad5dc6cc33831004a444643b322c368ff42 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 14 Jun 2013 14:17:30 +0400 Subject: [PATCH] #184: small refactoring according to Alexander's comment, added comments --- app/helpers/git_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/git_helper.rb b/app/helpers/git_helper.rb index 9a9ecb90f..559deeeb3 100644 --- a/app/helpers/git_helper.rb +++ b/app/helpers/git_helper.rb @@ -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')