diff options
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r-- | lib/api/commit_statuses.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb index 088d5bac587..323a7086890 100644 --- a/lib/api/commit_statuses.rb +++ b/lib/api/commit_statuses.rb @@ -22,8 +22,8 @@ module API not_found!('Commit') unless user_project.commit(params[:sha]) - ci_commits = user_project.pipelines.where(sha: params[:sha]) - statuses = ::CommitStatus.where(pipeline: ci_commits) + pipelines = user_project.pipelines.where(sha: params[:sha]) + statuses = ::CommitStatus.where(pipeline: pipelines) statuses = statuses.latest unless parse_boolean(params[:all]) statuses = statuses.where(ref: params[:ref]) if params[:ref].present? statuses = statuses.where(stage: params[:stage]) if params[:stage].present? @@ -64,11 +64,11 @@ module API ref = branches.first end - ci_commit = @project.ensure_pipeline(commit.sha, ref) + pipeline = @project.ensure_pipeline(commit.sha, ref) name = params[:name] || params[:context] - status = GenericCommitStatus.running_or_pending.find_by(pipeline: ci_commit, name: name, ref: params[:ref]) - status ||= GenericCommitStatus.new(project: @project, pipeline: ci_commit, user: current_user) + status = GenericCommitStatus.running_or_pending.find_by(pipeline: pipeline, name: name, ref: params[:ref]) + status ||= GenericCommitStatus.new(project: @project, pipeline: pipeline, user: current_user) status.update(attrs) case params[:state].to_s |