diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-30 13:15:21 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-30 13:15:21 +0000 |
commit | a8e05cec000f3d2b17b966115c9d7b69629498db (patch) | |
tree | 8d245cfd4ac2a4624457620299dbf8551ecd193e | |
parent | d73d2a5e5851dd97223705272f05a1e2a87ffb5d (diff) | |
parent | e1522ec85582962c12f875a46a5853d6ae570d0b (diff) | |
download | gitlab-ce-a8e05cec000f3d2b17b966115c9d7b69629498db.tar.gz |
Merge branch 'rs-build-ssh-path-prefix' into 'master'
Simplify `build_gitlab_shell_ssh_path_prefix`
See merge request !1928
-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 444e91109df..62619241001 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 |