diff options
author | David Turner <dturner@twosigma.com> | 2017-08-02 21:14:50 +0300 |
---|---|---|
committer | David Turner <novalis@novalis.org> | 2017-09-30 01:12:03 +0300 |
commit | dbcf48af8b21c0f1e54b73ea421911028081e1c1 (patch) | |
tree | 079829ac40d22cd745749d8cfaf5c56c21c4112d /spec/lib/gitlab/workhorse_spec.rb | |
parent | 999b7e553b1e1e04c2be4289b94557813f140cfe (diff) |
Add username as GL_USERNAME in hooks (http)
When calling pre-receive, post-receive, and update hooks, add the GitLab
username as the GL_USERNAME environment variable.
This patch only handles cases where pushes are over http, or via
the web interface. Later, we will address the ssh case.
Diffstat (limited to 'spec/lib/gitlab/workhorse_spec.rb')
-rw-r--r-- | spec/lib/gitlab/workhorse_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb index 5708aa6754f..e56e2df8376 100644 --- a/spec/lib/gitlab/workhorse_spec.rb +++ b/spec/lib/gitlab/workhorse_spec.rb @@ -182,7 +182,12 @@ describe Gitlab::Workhorse do let(:repo_path) { repository.path_to_repo } let(:action) { 'info_refs' } let(:params) do - { GL_ID: "user-#{user.id}", GL_REPOSITORY: "project-#{project.id}", RepoPath: repo_path } + { + GL_ID: "user-#{user.id}", + GL_USERNAME: user.username, + GL_REPOSITORY: "project-#{project.id}", + RepoPath: repo_path + } end subject { described_class.git_http_ok(repository, false, user, action) } @@ -191,7 +196,12 @@ describe Gitlab::Workhorse do context 'when is_wiki' do let(:params) do - { GL_ID: "user-#{user.id}", GL_REPOSITORY: "wiki-#{project.id}", RepoPath: repo_path } + { + GL_ID: "user-#{user.id}", + GL_USERNAME: user.username, + GL_REPOSITORY: "wiki-#{project.id}", + RepoPath: repo_path + } end subject { described_class.git_http_ok(repository, true, user, action) } |