summaryrefslogtreecommitdiff
path: root/lib/api/commits.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-21 15:13:40 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-24 12:29:36 +0200
commit8ed7ac9d443563a62a6aa03a2ec72b9fcb0d2df1 (patch)
treeb787add194486ac4346c2de2874b32db6d37c635 /lib/api/commits.rb
parent84a1590252c63c710bceaa7a394799cdc5109505 (diff)
downloadgitlab-ce-8ed7ac9d443563a62a6aa03a2ec72b9fcb0d2df1.tar.gz
Use project.commit convenience method.
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r--lib/api/commits.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index 0de4e720ffe..23270b1c0f4 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -32,7 +32,7 @@ module API
# GET /projects/:id/repository/commits/:sha
get ":id/repository/commits/:sha" do
sha = params[:sha]
- commit = user_project.repository.commit(sha)
+ commit = user_project.commit(sha)
not_found! "Commit" unless commit
present commit, with: Entities::RepoCommitDetail
end
@@ -46,7 +46,7 @@ module API
# GET /projects/:id/repository/commits/:sha/diff
get ":id/repository/commits/:sha/diff" do
sha = params[:sha]
- commit = user_project.repository.commit(sha)
+ commit = user_project.commit(sha)
not_found! "Commit" unless commit
commit.diffs
end
@@ -60,7 +60,7 @@ module API
# GET /projects/:id/repository/commits/:sha/comments
get ':id/repository/commits/:sha/comments' do
sha = params[:sha]
- commit = user_project.repository.commit(sha)
+ commit = user_project.commit(sha)
not_found! 'Commit' unless commit
notes = Note.where(commit_id: commit.id)
present paginate(notes), with: Entities::CommitNote
@@ -81,7 +81,7 @@ module API
required_attributes! [:note]
sha = params[:sha]
- commit = user_project.repository.commit(sha)
+ commit = user_project.commit(sha)
not_found! 'Commit' unless commit
opts = {
note: params[:note],