summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab_shell.rb2
-rw-r--r--spec/gitlab_shell_spec.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 39dabe9..78fdfe8 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -118,7 +118,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
self.repo_path = status.repository_path
@gl_repository = status.gl_repository
- @git_protocol = status.git_protocol
+ @git_protocol = ENV['GIT_PROTOCOL']
@gitaly = status.gitaly
@username = status.gl_username
if defined?(@who)
diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb
index f2c215e..382cad4 100644
--- a/spec/gitlab_shell_spec.rb
+++ b/spec/gitlab_shell_spec.rb
@@ -162,6 +162,10 @@ describe GitlabShell do
)
end
+ before do
+ allow(ENV).to receive(:[]).with('GIT_PROTOCOL').and_return(git_protocol)
+ end
+
shared_examples_for 'upload-pack' do |command|
let(:ssh_cmd) { "#{command} gitlab-ci.git" }
after { subject.exec(ssh_cmd) }
@@ -462,7 +466,7 @@ describe GitlabShell do
'GL_ID' => gl_id,
'GL_PROTOCOL' => 'ssh',
'GL_REPOSITORY' => gl_repository,
- 'GL_USERNAME' => 'testuser',
+ 'GL_USERNAME' => 'testuser'
}
end
let(:exec_options) { { unsetenv_others: true, chdir: ROOT_PATH } }