diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-11-29 17:52:40 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-11-29 17:52:40 -0500 |
commit | e1522ec85582962c12f875a46a5853d6ae570d0b (patch) | |
tree | 1fd57c8cc418424517f6e069454fa2838e47b8ee | |
parent | 15291c89745403c81aaf4225bc825c131e69a8ab (diff) | |
download | gitlab-ce-e1522ec85582962c12f875a46a5853d6ae570d0b.tar.gz |
Simplify `build_gitlab_shell_ssh_path_prefix`rs-build-ssh-path-prefix
-rw-r--r-- | config/initializers/1_settings.rb | 8 |
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 |