diff options
-rw-r--r-- | qa/qa/git/location.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/qa/qa/git/location.rb b/qa/qa/git/location.rb index 55f7213972d..30538388530 100644 --- a/qa/qa/git/location.rb +++ b/qa/qa/git/location.rb @@ -13,14 +13,15 @@ module QA # Settings#build_gitlab_shell_ssh_path_prefix def initialize(git_uri) @git_uri = git_uri - @uri = if git_uri.start_with?('ssh://') - URI.parse(git_uri) - else - *rest, path = git_uri.split(':') - # Host cannot have : so we'll need to escape it - user_host = rest.join('%3A').sub(/\A\[(.+)\]\z/, '\1') - URI.parse("ssh://#{user_host}/#{path}") - end + @uri = + if git_uri.start_with?('ssh://') + URI.parse(git_uri) + else + *rest, path = git_uri.split(':') + # Host cannot have : so we'll need to escape it + user_host = rest.join('%3A').sub(/\A\[(.+)\]\z/, '\1') + URI.parse("ssh://#{user_host}/#{path}") + end end def port |