summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-11-29 17:52:40 -0500
committerRobert Speicher <rspeicher@gmail.com>2015-11-29 17:52:40 -0500
commite1522ec85582962c12f875a46a5853d6ae570d0b (patch)
tree1fd57c8cc418424517f6e069454fa2838e47b8ee
parent15291c89745403c81aaf4225bc825c131e69a8ab (diff)
downloadgitlab-ce-rs-build-ssh-path-prefix.tar.gz
Simplify `build_gitlab_shell_ssh_path_prefix`rs-build-ssh-path-prefix
-rw-r--r--config/initializers/1_settings.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index b162b8a83fc..abe08d57186 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -33,13 +33,15 @@ class Settings < Settingslogic
end
def build_gitlab_shell_ssh_path_prefix
+ user_host = "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}"
+
if gitlab_shell.ssh_port != 22
- "ssh://#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:#{gitlab_shell.ssh_port}/"
+ "ssh://#{user_host}:#{gitlab_shell.ssh_port}/"
else
if gitlab_shell.ssh_host.include? ':'
- "[#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}]:"
+ "[#{user_host}]:"
else
- "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:"
+ "#{user_host}:"
end
end
end