Commit a8e05cec authored by Douwe Maan's avatar Douwe Maan

Merge branch 'rs-build-ssh-path-prefix' into 'master'

Simplify `build_gitlab_shell_ssh_path_prefix`



See merge request !1928
parents d73d2a5e e1522ec8
No related merge requests found
...@@ -33,13 +33,15 @@ class Settings < Settingslogic ...@@ -33,13 +33,15 @@ class Settings < Settingslogic
end end
def build_gitlab_shell_ssh_path_prefix def build_gitlab_shell_ssh_path_prefix
user_host = "#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}"
if gitlab_shell.ssh_port != 22 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 else
if gitlab_shell.ssh_host.include? ':' if gitlab_shell.ssh_host.include? ':'
"[#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}]:" "[#{user_host}]:"
else else
"#{gitlab_shell.ssh_user}@#{gitlab_shell.ssh_host}:" "#{user_host}:"
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment