summaryrefslogtreecommitdiff
path: root/lib/gitlab_post_receive.rb
diff options
context:
space:
mode:
authorJonathon Reinhart <Jonathon.Reinhart@gmail.com>2017-08-29 22:45:36 -0400
committerJonathon Reinhart <Jonathon.Reinhart@gmail.com>2018-12-13 22:34:15 -0500
commit30a06eca35d38ac91c1f2beadb2443f37d28476b (patch)
tree1f0f5e4e1a9378948effa41be4e803e4b49811ba /lib/gitlab_post_receive.rb
parent857e86a6e666b20679d5cb43ce85fe9576fea678 (diff)
downloadgitlab-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 'lib/gitlab_post_receive.rb')
-rw-r--r--lib/gitlab_post_receive.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab_post_receive.rb b/lib/gitlab_post_receive.rb
index ea57f6a..5dd9955 100644
--- a/lib/gitlab_post_receive.rb
+++ b/lib/gitlab_post_receive.rb
@@ -8,18 +8,19 @@ require 'securerandom'
class GitlabPostReceive
attr_reader :config, :gl_repository, :repo_path, :changes, :jid
- def initialize(gl_repository, repo_path, actor, changes)
+ def initialize(gl_repository, repo_path, actor, changes, push_opts)
@config = GitlabConfig.new
@gl_repository = gl_repository
@repo_path = repo_path.strip
@actor = actor
@changes = changes
+ @push_opts = push_opts
@jid = SecureRandom.hex(12)
end
def exec
response = GitlabMetrics.measure("post-receive") do
- api.post_receive(gl_repository, @actor, changes)
+ api.post_receive(gl_repository, @actor, changes, @push_opts)
end
return false unless response