summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-01-22 15:36:48 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-01-22 15:36:48 +0000
commitf02be29e52ceb5622e3182830be833f4dfe7c9ce (patch)
tree7fae317275754e22f656fd71a5ed804aece0b939 /lib
parent7b6fa5ffcbead7c45c331df6d4c7a5352b6c3521 (diff)
parenta2477ec2e363c58857e5f8f08a370282bffa57cf (diff)
downloadgitlab-ce-f02be29e52ceb5622e3182830be833f4dfe7c9ce.tar.gz
Merge branch '55966-when-ref-is-ambiguous-createpipelineservice-raises-an-error' into 'master'
Resolve "When ref is ambiguous, `CreatePipelineService` raises an error" Closes #55966 See merge request gitlab-org/gitlab-ce!24437
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/pipeline/chain/build.rb1
-rw-r--r--lib/gitlab/ci/pipeline/chain/populate.rb4
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/ci/pipeline/chain/build.rb b/lib/gitlab/ci/pipeline/chain/build.rb
index d33d1edfe35..41632211374 100644
--- a/lib/gitlab/ci/pipeline/chain/build.rb
+++ b/lib/gitlab/ci/pipeline/chain/build.rb
@@ -17,7 +17,6 @@ module Gitlab
user: @command.current_user,
pipeline_schedule: @command.schedule,
merge_request: @command.merge_request,
- protected: @command.protected_ref?,
variables_attributes: Array(@command.variables_attributes)
)
diff --git a/lib/gitlab/ci/pipeline/chain/populate.rb b/lib/gitlab/ci/pipeline/chain/populate.rb
index 633d3cd4f6b..0405292a25b 100644
--- a/lib/gitlab/ci/pipeline/chain/populate.rb
+++ b/lib/gitlab/ci/pipeline/chain/populate.rb
@@ -13,6 +13,10 @@ module Gitlab
# Allocate next IID. This operation must be outside of transactions of pipeline creations.
pipeline.ensure_project_iid!
+ # Protect the pipeline. This is assigned in Populate instead of
+ # Build to prevent erroring out on ambiguous refs.
+ pipeline.protected = @command.protected_ref?
+
##
# Populate pipeline with block argument of CreatePipelineService#execute.
#