diff options
author | David Turner <dturner@twosigma.com> | 2017-08-03 21:38:33 +0300 |
---|---|---|
committer | David Turner <novalis@novalis.org> | 2017-09-30 01:16:55 +0300 |
commit | 01ce58bde4ddb9bdf3c54dbd2cc65f7a6b81661e (patch) | |
tree | bf4a2f8c34e09a5577b4935c0fed0c5d9eb8a7c1 /lib/gitlab/git | |
parent | dbcf48af8b21c0f1e54b73ea421911028081e1c1 (diff) |
add username to authorized result, so that gitlab-shell can pass it to hooks
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r-- | lib/gitlab/git/hook.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb index 8ccb3e64636..e29a1f7afa1 100644 --- a/lib/gitlab/git/hook.rb +++ b/lib/gitlab/git/hook.rb @@ -83,12 +83,11 @@ module Gitlab def call_update_hook(gl_id, gl_username, oldrev, newrev, ref) Dir.chdir(repo_path) do - stdout, stderr, status = Open3.capture3( - { - 'GL_ID' => gl_id, - 'GL_USERNAME' => gl_username - }, - path, ref, oldrev, newrev) + env = { + 'GL_ID' => gl_id, + 'GL_USERNAME' => gl_username + } + stdout, stderr, status = Open3.capture3(env, path, ref, oldrev, newrev) [status.success?, (stderr.presence || stdout).gsub(/\R/, "<br>").html_safe] end end |