Commit 4dd99884 authored by Sean McGivern's avatar Sean McGivern Committed by Winnie Hellmann
Browse files

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 69dd59aec9e5f8959fa36eb74db28d71aad4212b)

f767dd4a Fix go-import meta data when enabled_git_access_protocol is a blank string
parent 260c2e5d7ac0
......@@ -42,12 +42,11 @@ def go_body(path)
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 @@
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