Merge branch 'sh-optimize-project-commit-api' into 'master'
Optimize creation of commit API by using Repository#commit instead of Repository#commits See merge request !12623
This commit is contained in:
commit
75ac425c94
2 changed files with 5 additions and 1 deletions
4
changelogs/unreleased/sh-optimize-project-commit-api.yml
Normal file
4
changelogs/unreleased/sh-optimize-project-commit-api.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Optimize creation of commit API by using Repository#commit instead of Repository#commits
|
||||
merge_request:
|
||||
author:
|
|
@ -67,7 +67,7 @@ module API
|
|||
result = ::Files::MultiService.new(user_project, current_user, attrs).execute
|
||||
|
||||
if result[:status] == :success
|
||||
commit_detail = user_project.repository.commits(result[:result], limit: 1).first
|
||||
commit_detail = user_project.repository.commit(result[:result])
|
||||
present commit_detail, with: Entities::RepoCommitDetail
|
||||
else
|
||||
render_api_error!(result[:message], 400)
|
||||
|
|
Loading…
Reference in a new issue