Commit 46ff67a5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix_custom_hook_envs' into 'master'

Clean environment variables when running git hooks

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/20977

See merge request !6344
parents 08b48b7d 71857224
...@@ -135,6 +135,7 @@ v 8.12.0 (unreleased) ...@@ -135,6 +135,7 @@ v 8.12.0 (unreleased)
- Return 204 instead of 404 for /ci/api/v1/builds/register.json if no builds are scheduled for a runner !6225 - Return 204 instead of 404 for /ci/api/v1/builds/register.json if no builds are scheduled for a runner !6225
- Fix Gitlab::Popen.popen thread-safety issue - Fix Gitlab::Popen.popen thread-safety issue
- Add specs to removing project (Katarzyna Kobierska Ula Budziszewska) - Add specs to removing project (Katarzyna Kobierska Ula Budziszewska)
- Clean environment variables when running git hooks
v 8.11.6 v 8.11.6
- Fix unnecessary horizontal scroll area in pipeline visualizations. !6005 - Fix unnecessary horizontal scroll area in pipeline visualizations. !6005
......
...@@ -17,6 +17,7 @@ module Gitlab ...@@ -17,6 +17,7 @@ module Gitlab
def trigger(gl_id, oldrev, newrev, ref) def trigger(gl_id, oldrev, newrev, ref)
return [true, nil] unless exists? return [true, nil] unless exists?
Bundler.with_clean_env do
case name case name
when "pre-receive", "post-receive" when "pre-receive", "post-receive"
call_receive_hook(gl_id, oldrev, newrev, ref) call_receive_hook(gl_id, oldrev, newrev, ref)
...@@ -24,6 +25,7 @@ module Gitlab ...@@ -24,6 +25,7 @@ module Gitlab
call_update_hook(gl_id, oldrev, newrev, ref) call_update_hook(gl_id, oldrev, newrev, ref)
end end
end end
end
private private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment