BigW Consortium Gitlab

Commit 4dd99884 by Sean McGivern Committed by Winnie Hellmann

Merge branch 'dm-go-get-blank-enabled-protocol' into 'master'

Fix go-import meta data when enabled_git_access_protocol is a blank string Closes #40256 See merge request gitlab-org/gitlab-ce!15448 (cherry picked from commit 69dd59ae) f767dd4a Fix go-import meta data when enabled_git_access_protocol is a blank string
parent 9f62c679
......@@ -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
......
......@@ -127,6 +127,14 @@ describe Gitlab::Middleware::Go do
include_examples 'go-get=1', enabled_protocol: nil
end
context 'with nothing disabled (blank string)' do
before do
stub_application_setting(enabled_git_access_protocol: '')
end
include_examples 'go-get=1', enabled_protocol: nil
end
end
def go
......
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