summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-06-30 08:53:14 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-06-30 08:53:14 +0000
commit2d33952790ca07893f110ee1c46afcbce4da384b (patch)
tree1c799d26826fafec86a406fb128d623fc32bf249 /lib
parent3e93ddffd884b6f60e31dee724bcb38e415782fb (diff)
parentf4e6aba1bbeca043a29b4903cef2f5b99a1faac3 (diff)
downloadgitlab-ce-2d33952790ca07893f110ee1c46afcbce4da384b.tar.gz
Merge branch '34502-gitlab-git-hook-should-set-the-gl_repository-environment-variable' into 'master'
Set the GL_REPOSITORY env variable on Gitlab::Git::Hook Closes #34502 See merge request !12572
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/git/hook.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/gitlab/git/hook.rb b/lib/gitlab/git/hook.rb
index bd90d24a2ec..5042916343b 100644
--- a/lib/gitlab/git/hook.rb
+++ b/lib/gitlab/git/hook.rb
@@ -4,9 +4,10 @@ module Gitlab
GL_PROTOCOL = 'web'.freeze
attr_reader :name, :repo_path, :path
- def initialize(name, repo_path)
+ def initialize(name, project)
@name = name
- @repo_path = repo_path
+ @project = project
+ @repo_path = project.repository.path
@path = File.join(repo_path.strip, 'hooks', name)
end
@@ -38,7 +39,8 @@ module Gitlab
vars = {
'GL_ID' => gl_id,
'PWD' => repo_path,
- 'GL_PROTOCOL' => GL_PROTOCOL
+ 'GL_PROTOCOL' => GL_PROTOCOL,
+ 'GL_REPOSITORY' => Gitlab::GlRepository.gl_repository(@project, false)
}
options = {