summaryrefslogtreecommitdiff
path: root/app/controllers/ci/commits_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/ci/commits_controller.rb')
-rw-r--r--app/controllers/ci/commits_controller.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/ci/commits_controller.rb b/app/controllers/ci/commits_controller.rb
index 7a0a500fbe6..acf9189572c 100644
--- a/app/controllers/ci/commits_controller.rb
+++ b/app/controllers/ci/commits_controller.rb
@@ -13,7 +13,7 @@ module Ci
end
def status
- commit = Ci::Project.find(params[:project_id]).commits.find_by_sha_and_ref!(params[:id], params[:ref_id])
+ commit = Ci::Project.find(params[:project_id]).commits.find_by_sha!(params[:id], params[:ref_id])
render json: commit.to_json(only: [:id, :sha], methods: [:status, :coverage])
rescue ActiveRecord::RecordNotFound
render json: { status: "not_found" }
@@ -22,7 +22,7 @@ module Ci
def cancel
commit.builds.running_or_pending.each(&:cancel)
- redirect_to ci_project_ref_commits_path(project, commit.ref, commit.sha)
+ redirect_to ci_project_commits_path(project, commit.sha)
end
private
@@ -32,7 +32,7 @@ module Ci
end
def commit
- @commit ||= Ci::Project.find(params[:project_id]).commits.find_by_sha_and_ref!(params[:id], params[:ref_id])
+ @commit ||= Ci::Project.find(params[:project_id]).commits.find_by_sha!(params[:id])
end
end
end