diff options
author | Jonathon Reinhart <Jonathon.Reinhart@gmail.com> | 2017-08-29 22:45:36 -0400 |
---|---|---|
committer | Jonathon Reinhart <Jonathon.Reinhart@gmail.com> | 2018-12-13 22:34:15 -0500 |
commit | 30a06eca35d38ac91c1f2beadb2443f37d28476b (patch) | |
tree | 1f0f5e4e1a9378948effa41be4e803e4b49811ba /hooks | |
parent | 857e86a6e666b20679d5cb43ce85fe9576fea678 (diff) | |
download | gitlab-shell-30a06eca35d38ac91c1f2beadb2443f37d28476b.tar.gz |
Pass push options to GitLab /internal/post_receive API
push_opts[] is named as such so that it becomes an array in the
GitLab internal Grape::API params hash. If it were named push_opts, only
the final (scalar) push_opts parameter would be present.
Also update specs to include push_opts parameter:
- gitlab_post_receive_spec
- gitlab_net_spec for the internal API change
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/post-receive | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hooks/post-receive b/hooks/post-receive index 30f4be1..5098158 100755 --- a/hooks/post-receive +++ b/hooks/post-receive @@ -9,9 +9,12 @@ gl_repository = ENV['GL_REPOSITORY'] repo_path = Dir.pwd require_relative '../lib/gitlab_custom_hook' +require_relative '../lib/hooks_utils' require_relative '../lib/gitlab_post_receive' -if GitlabPostReceive.new(gl_repository, repo_path, key_id, refs).exec && +push_opts = HooksUtils.get_push_options + +if GitlabPostReceive.new(gl_repository, repo_path, key_id, refs, push_opts).exec && GitlabCustomHook.new(repo_path, key_id).post_receive(refs) exit 0 else |