summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-06-29 15:22:40 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-06-29 15:22:40 -0400
commitf4e6aba1bbeca043a29b4903cef2f5b99a1faac3 (patch)
tree44a69ea3eba402594c0a1567459f969834d4d82c /lib
parent6205e45727db4d6720b7c3dc6ce010872b4f1628 (diff)
downloadgitlab-ce-f4e6aba1bbeca043a29b4903cef2f5b99a1faac3.tar.gz
Set the GL_REPOSITORY env variable on Gitlab::Git::Hook34502-gitlab-git-hook-should-set-the-gl_repository-environment-variable
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 = {