summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/post-receive3
-rwxr-xr-xhooks/pre-receive3
2 files changed, 4 insertions, 2 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index 7877306..3504a48 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -5,12 +5,13 @@
refs = $stdin.read
key_id = ENV.delete('GL_ID')
+gl_repository = ENV.delete('GL_REPOSITORY')
repo_path = Dir.pwd
require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_post_receive'
-if GitlabPostReceive.new(repo_path, key_id, refs).exec &&
+if GitlabPostReceive.new(gl_repository, repo_path, key_id, refs).exec &&
GitlabCustomHook.new(repo_path, key_id).post_receive(refs)
exit 0
else
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 1b16fd0..e8e04d8 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -7,6 +7,7 @@ refs = $stdin.read
key_id = ENV.delete('GL_ID')
protocol = ENV.delete('GL_PROTOCOL')
repo_path = Dir.pwd
+gl_repository = ENV['GL_REPOSITORY']
require_relative '../lib/gitlab_custom_hook'
require_relative '../lib/gitlab_reference_counter'
@@ -16,7 +17,7 @@ require_relative '../lib/gitlab_access'
# last so that it only runs if everything else succeeded. On post-receive on the
# other hand, we run GitlabPostReceive first because the push is already done
# and we don't want to skip it if the custom hook fails.
-if GitlabAccess.new(repo_path, key_id, refs, protocol).exec &&
+if GitlabAccess.new(gl_repository, repo_path, key_id, refs, protocol).exec &&
GitlabCustomHook.new(repo_path, key_id).pre_receive(refs) &&
GitlabReferenceCounter.new(repo_path).increase
exit 0