Commit 55e488d6 authored by Rémy Coutable's avatar Rémy Coutable

Fix a Ruby 2.4 incompatibility in Ci::CreatePipelineService

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent b753fc6d
...@@ -36,7 +36,7 @@ module Ci ...@@ -36,7 +36,7 @@ module Ci
project: project, project: project,
current_user: current_user, current_user: current_user,
push_options: params[:push_options], push_options: params[:push_options],
**extra_options(**options)) **extra_options(options))
sequence = Gitlab::Ci::Pipeline::Chain::Sequence sequence = Gitlab::Ci::Pipeline::Chain::Sequence
.new(pipeline, command, SEQUENCE) .new(pipeline, command, SEQUENCE)
...@@ -108,7 +108,12 @@ module Ci ...@@ -108,7 +108,12 @@ module Ci
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def extra_options def extra_options(options = {})
# In Ruby 2.4, even when options is empty, f(**options) doesn't work when f
# doesn't have any parameters. We reproduce the Ruby 2.5 behavior by
# checking explicitely that no arguments are given.
raise ArgumentError if options.any?
{} # overriden in EE {} # overriden in EE
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment