diff options
author | Rémy Coutable <remy@rymai.me> | 2019-02-12 17:46:13 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-02-12 19:07:16 +0100 |
commit | 55e488d6d5c417429c896fabcec3807133ad88ac (patch) | |
tree | ef266702347574cd8b6028ba645b916c76aeeac1 | |
parent | b753fc6daddd9e599ff848c5347cd7fc15f6a7c4 (diff) | |
download | gitlab-ce-55e488d6d5c417429c896fabcec3807133ad88ac.tar.gz |
Fix a Ruby 2.4 incompatibility in Ci::CreatePipelineService
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index 699b3e8555e..354e53a367c 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -36,7 +36,7 @@ module Ci project: project, current_user: current_user, push_options: params[:push_options], - **extra_options(**options)) + **extra_options(options)) sequence = Gitlab::Ci::Pipeline::Chain::Sequence .new(pipeline, command, SEQUENCE) @@ -108,7 +108,12 @@ module Ci end # 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 end end |