diff options
author | David Turner <novalis@novalis.org> | 2017-08-03 14:47:39 -0400 |
---|---|---|
committer | David Turner <novalis@novalis.org> | 2017-09-28 15:45:29 -0400 |
commit | 2f92f124d1297ea58935f37609b7e2b0709e64d3 (patch) | |
tree | 8dfcf7c50c962fa9743eb8a19c70ad2d2298daba /lib/gitlab_shell.rb | |
parent | bee2bcc5546031aa66d0a3e028bb709282275254 (diff) | |
download | gitlab-shell-2f92f124d1297ea58935f37609b7e2b0709e64d3.tar.gz |
pass gl_username through to hooks
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r-- | lib/gitlab_shell.rb | 9 |
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'] |