summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-06-01 10:21:22 +0100
committerSean McGivern <sean@gitlab.com>2016-06-01 20:29:54 +0100
commitd863d86aeb1993c2032da0610b3662e61960eb38 (patch)
tree4eb83c80e800467aecc7922a5ffd987313a1fcb0 /doc
parente9bb895b5ac639bcb4166b23b796566f0320741a (diff)
downloadgitlab-ce-d863d86aeb1993c2032da0610b3662e61960eb38.tar.gz
Add `sha` parameter to MR accept API
The `sha` parameter is optional, and when present, must match the current HEAD SHA of the source branch. Otherwise, the API call fails with a 409 Conflict and a message containing the current HEAD for the source branch. Also tidy up some doc wording.
Diffstat (limited to 'doc')
-rw-r--r--doc/api/merge_requests.md11
1 files changed, 7 insertions, 4 deletions
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 8217e30fe25..16b892dc3b7 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -413,11 +413,13 @@ curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.c
Merge changes submitted with MR using this API.
-If merge success you get `200 OK`.
+If the merge succeeds you'll get a `200 OK`.
-If it has some conflicts and can not be merged - you get 405 and error message 'Branch cannot be merged'
+If it has some conflicts and can not be merged - you'll get a 405 and the error message 'Branch cannot be merged'
-If merge request is already merged or closed - you get 405 and error message 'Method Not Allowed'
+If merge request is already merged or closed - you'll get a 406 and the error message 'Method Not Allowed'
+
+If the `sha` parameter is passed and does not match the HEAD of the source - you'll get a 409 and the error message 'SHA does not match HEAD of source branch'
If you don't have permissions to accept this merge request - you'll get a 401
@@ -431,7 +433,8 @@ Parameters:
- `merge_request_id` (required) - ID of MR
- `merge_commit_message` (optional) - Custom merge commit message
- `should_remove_source_branch` (optional) - if `true` removes the source branch
-- `merged_when_build_succeeds` (optional) - if `true` the MR is merge when the build succeeds
+- `merged_when_build_succeeds` (optional) - if `true` the MR is merged when the build succeeds
+- `sha` (optional) - if present, then this SHA must match the HEAD of the source branch, otherwise the merge will fail
```json
{