summaryrefslogtreecommitdiff
path: root/lib/api/commit_statuses.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-05-24 15:13:51 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-05-31 14:17:49 +0200
commit161af17c1b69e7e00aefcd4f540a55755259ceda (patch)
tree6a2c94a350a2fa53e05f07927df543ed3ba1a7bc /lib/api/commit_statuses.rb
parent19ee16a0f85dd4bacddbd066237e62a1bbb7113a (diff)
downloadgitlab-ce-161af17c1b69e7e00aefcd4f540a55755259ceda.tar.gz
Introduce source to pipeline entitytrigger-source
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r--lib/api/commit_statuses.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index 827a38d33da..10f2d5ef6a3 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -68,7 +68,14 @@ module API
name = params[:name] || params[:context] || 'default'
- pipeline = @project.ensure_pipeline(ref, commit.sha, current_user)
+ pipeline = @project.pipeline_for(ref, commit.sha)
+ unless pipeline
+ pipeline = @project.pipelines.create!(
+ source: :external,
+ sha: commit.sha,
+ ref: ref,
+ user: current_user)
+ end
status = GenericCommitStatus.running_or_pending.find_or_initialize_by(
project: @project,