diff options
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/post-receive | 2 | ||||
-rwxr-xr-x | hooks/pre-receive | 2 | ||||
-rwxr-xr-x | hooks/update | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/hooks/post-receive b/hooks/post-receive index b7bc85e..b84d0d1 100755 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -11,7 +11,7 @@ require_relative '../lib/gitlab_custom_hook' require_relative '../lib/gitlab_post_receive' if GitlabPostReceive.new(repo_path, key_id, refs).exec && - GitlabCustomHook.new.post_receive(refs, repo_path) + GitlabCustomHook.new(key_id).post_receive(refs, repo_path) exit 0 else exit 1 diff --git a/hooks/pre-receive b/hooks/pre-receive index 09fa42b..4d9a4e9 100755 --- a/hooks/pre-receive +++ b/hooks/pre-receive @@ -17,7 +17,7 @@ require_relative '../lib/gitlab_access' # 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 && - GitlabCustomHook.new.pre_receive(refs, repo_path) && + GitlabCustomHook.new(key_id).pre_receive(refs, repo_path) && GitlabReferenceCounter.new(repo_path).increase exit 0 else diff --git a/hooks/update b/hooks/update index f1ac8e7..223575d 100755 --- a/hooks/update +++ b/hooks/update @@ -3,14 +3,15 @@ # This file was placed here by GitLab. It makes sure that your pushed commits # will be processed properly. -ref_name = ARGV[0] +ref_name = ARGV[0] old_value = ARGV[1] new_value = ARGV[2] repo_path = Dir.pwd +key_id = ENV.delete('GL_ID') require_relative '../lib/gitlab_custom_hook' -if GitlabCustomHook.new.update(ref_name, old_value, new_value, repo_path) +if GitlabCustomHook.new(key_id).update(ref_name, old_value, new_value, repo_path) exit 0 else exit 1 |