diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 21:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 21:08:47 +0000 |
commit | e4ea43b2b85ad5f3115f00220601eb719705139a (patch) | |
tree | 1888a43f802e45ebb8dfed59595a790807777c6f /lib/api/commit_statuses.rb | |
parent | 390582e118752426acf5cb25ec99103d312d891c (diff) | |
download | gitlab-ce-e4ea43b2b85ad5f3115f00220601eb719705139a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r-- | lib/api/commit_statuses.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb index 6e26ee309f0..2d5253fe9f1 100644 --- a/lib/api/commit_statuses.rb +++ b/lib/api/commit_statuses.rb @@ -76,14 +76,12 @@ module API name = params[:name] || params[:context] || 'default' - unless pipeline - pipeline = user_project.ci_pipelines.create!( - source: :external, - sha: commit.sha, - ref: ref, - user: current_user, - protected: user_project.protected_for?(ref)) - end + pipeline ||= user_project.ci_pipelines.create!( + source: :external, + sha: commit.sha, + ref: ref, + user: current_user, + protected: user_project.protected_for?(ref)) status = GenericCommitStatus.running_or_pending.find_or_initialize_by( project: user_project, |