Check if commit exists first in commit status API
This commit is contained in:
parent
8c66d739c1
commit
85a461e096
|
|
@ -20,8 +20,8 @@ module API
|
|||
get ':id/repository/commits/:sha/statuses' do
|
||||
authorize!(:read_commit_status, user_project)
|
||||
|
||||
ci_commit = user_project.ci_commit(params[:sha])
|
||||
not_found!('Commit') unless user_project.commit(params[:sha])
|
||||
ci_commit = user_project.ci_commit(params[:sha])
|
||||
return [] unless ci_commit
|
||||
|
||||
statuses = ci_commit.statuses
|
||||
|
|
|
|||
Loading…
Reference in New Issue