diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-17 14:17:16 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-17 14:17:16 +0300 |
commit | f767dd4a4da2086de699eb55f468a646846b4632 (patch) | |
tree | 6cb6d48839f58ace54bed007fe480bb415872a7a /lib/gitlab/middleware | |
parent | 4d55503217316ea9a8a4f1a5523814b5eb20ed49 (diff) |
Fix go-import meta data when enabled_git_access_protocol is a blank string
Diffstat (limited to 'lib/gitlab/middleware')
-rw-r--r-- | lib/gitlab/middleware/go.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/gitlab/middleware/go.rb b/lib/gitlab/middleware/go.rb index cfc6b2a2029..1edda50e4b0 100644 --- a/lib/gitlab/middleware/go.rb +++ b/lib/gitlab/middleware/go.rb @@ -42,12 +42,11 @@ module Gitlab project_url = URI.join(config.gitlab.url, path) import_prefix = strip_url(project_url.to_s) - repository_url = case current_application_settings.enabled_git_access_protocol - when 'ssh' + repository_url = if current_application_settings.enabled_git_access_protocol == 'ssh' shell = config.gitlab_shell port = ":#{shell.ssh_port}" unless shell.ssh_port == 22 "ssh://#{shell.ssh_user}@#{shell.ssh_host}#{port}/#{path}.git" - when 'http', nil + else "#{project_url}.git" end |