Merge branch 'rs-cherry-pick-api' into 'master'
Resolve possible cherry pick API race condition Closes #53773 See merge request gitlab-org/gitlab-ce!22946
This commit is contained in:
commit
9adcd62df3
2 changed files with 10 additions and 3 deletions
5
changelogs/unreleased/rs-cherry-pick-api.yml
Normal file
5
changelogs/unreleased/rs-cherry-pick-api.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Resolve possible cherry pick API race condition
|
||||||
|
merge_request:
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -194,11 +194,13 @@ module API
|
||||||
branch_name: params[:branch]
|
branch_name: params[:branch]
|
||||||
}
|
}
|
||||||
|
|
||||||
result = ::Commits::CherryPickService.new(user_project, current_user, commit_params).execute
|
result = ::Commits::CherryPickService
|
||||||
|
.new(user_project, current_user, commit_params)
|
||||||
|
.execute
|
||||||
|
|
||||||
if result[:status] == :success
|
if result[:status] == :success
|
||||||
branch = find_branch!(params[:branch])
|
present user_project.repository.commit(result[:result]),
|
||||||
present user_project.repository.commit(branch.dereferenced_target), with: Entities::Commit
|
with: Entities::Commit
|
||||||
else
|
else
|
||||||
render_api_error!(result[:message], 400)
|
render_api_error!(result[:message], 400)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue