diff --git a/hooks/pre-receive b/hooks/pre-receive index 09fa42b7dbce1c222af5a2666455a81026dae8e0..16c659db9eabff37d2383a844dc3b3be8cbe66d1 100755 --- a/hooks/pre-receive +++ b/hooks/pre-receive @@ -4,8 +4,8 @@ # will be processed properly. refs = $stdin.read -key_id = ENV.delete('GL_ID') -protocol = ENV.delete('GL_PROTOCOL') +key_id = ENV['GL_ID'] +protocol = ENV['GL_PROTOCOL'] repo_path = Dir.pwd require_relative '../lib/gitlab_custom_hook' @@ -21,5 +21,7 @@ if GitlabAccess.new(repo_path, key_id, refs, protocol).exec && GitlabReferenceCounter.new(repo_path).increase exit 0 else + ENV['GL_ID'] = nil + exit 1 end