Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r--lib/api/commit_statuses.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index 1785362656e..c89abf72e2d 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -78,13 +78,16 @@ module API
name = params[:name] || params[:context] || 'default'
- pipeline ||= user_project.ci_pipelines.create!(
+ pipeline ||= user_project.ci_pipelines.build(
source: :external,
sha: commit.sha,
ref: ref,
user: current_user,
protected: user_project.protected_for?(ref))
+ pipeline.ensure_project_iid!
+ pipeline.save!
+
authorize! :update_pipeline, pipeline
status = GenericCommitStatus.running_or_pending.find_or_initialize_by(