summaryrefslogtreecommitdiff
path: root/lib/gitlab_shell.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-09-29 14:19:54 +0000
committerDouwe Maan <douwe@gitlab.com>2017-09-29 14:19:54 +0000
commit5ef63d10d93836cc6922445d4755e42d7fb599e5 (patch)
tree86ef8eca7008319f9aec8f3ca314c801bada3d52 /lib/gitlab_shell.rb
parent92a9877ba6fc3dc442321a7c7243b8b8a330a02f (diff)
parent2f92f124d1297ea58935f37609b7e2b0709e64d3 (diff)
downloadgitlab-shell-5ef63d10d93836cc6922445d4755e42d7fb599e5.tar.gz
Merge branch 'remote_user' into 'master'
translate gl_username -> REMOTE_USER See merge request gitlab-org/gitlab-shell!158
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r--lib/gitlab_shell.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb
index 243c629..e7e7f04 100644
--- a/lib/gitlab_shell.rb
+++ b/lib/gitlab_shell.rb
@@ -20,7 +20,7 @@ class GitlabShell
# to undo an already set parameter: https://www.spinics.net/lists/git/msg256772.html
GIT_CONFIG_SHOW_ALL_REFS = "transfer.hideRefs=!refs".freeze
- attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access, :show_all_refs
+ attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access, :show_all_refs, :username
attr_reader :repo_path
def initialize(key_id)
@@ -113,6 +113,7 @@ class GitlabShell
@gl_repository = status.gl_repository
@gitaly = status.gitaly
@show_all_refs = status.geo_node
+ @username = status.gl_username
end
def process_cmd(args)
@@ -139,7 +140,8 @@ class GitlabShell
gitaly_request = {
'repository' => @gitaly['repository'],
'gl_repository' => @gl_repository,
- 'gl_id' => @key_id
+ 'gl_id' => @key_id,
+ 'gl_username' => @username
}
gitaly_request['git_config_options'] = [GIT_CONFIG_SHOW_ALL_REFS] if @show_all_refs
@@ -168,7 +170,8 @@ class GitlabShell
'LANG' => ENV['LANG'],
'GL_ID' => @key_id,
'GL_PROTOCOL' => GL_PROTOCOL,
- 'GL_REPOSITORY' => @gl_repository
+ 'GL_REPOSITORY' => @gl_repository,
+ 'GL_USERNAME' => @username
}
if @gitaly && @gitaly.include?('token')
env['GITALY_TOKEN'] = @gitaly['token']