Commit e1522ec8 authored by Robert Speicher's avatar Robert Speicher

Simplify `build_gitlab_shell_ssh_path_prefix`

parent 15291c89
...@@ -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