summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_net.rb5
-rw-r--r--lib/gitlab_post_receive.rb5
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index cae3bdb..a0e1f12 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -119,11 +119,12 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
false
end
- def post_receive(gl_repository, identifier, changes)
+ def post_receive(gl_repository, identifier, changes, push_opts)
params = {
gl_repository: gl_repository,
identifier: identifier,
- changes: changes
+ changes: changes,
+ :"push_opts[]" => push_opts, # ruby <2.2 syntax
}
resp = post("#{internal_api_endpoint}/post_receive", params)
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