Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-11-30 16:15:21 +0300
committerDouwe Maan <douwe@gitlab.com>2015-11-30 16:15:21 +0300
commita8e05cec000f3d2b17b966115c9d7b69629498db (patch)
tree8d245cfd4ac2a4624457620299dbf8551ecd193e
parentd73d2a5e5851dd97223705272f05a1e2a87ffb5d (diff)
parente1522ec85582962c12f875a46a5853d6ae570d0b (diff)
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.rb8
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