If it has some conflicts and can not be merged - you'll get a 405 and the 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'll get a 406 and the 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 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
If you don't have permissions to accept this merge request - you'll get a `401`
```
```
PUT /projects/:id/merge_requests/:merge_request_id/merge
PUT /projects/:id/merge_requests/:merge_request_id/merge
...
@@ -520,13 +511,11 @@ Parameters:
...
@@ -520,13 +511,11 @@ Parameters:
## Cancel Merge When Build Succeeds
## Cancel Merge When Build Succeeds
If successful you'll get `200 OK`.
If you don't have permissions to accept this merge request - you'll get a `401`
If you don't have permissions to accept this merge request - you'll get a 401
If the merge request is already merged or closed - you get `405` and error message 'Method Not Allowed'
If the merge request is already merged or closed - you get 405 and error message 'Method Not Allowed'
In case the merge request is not set to be merged when the build succeeds, you'll also get a `406` error.
In case the merge request is not set to be merged when the build succeeds, you'll also get a 406 error.
```
```
PUT /projects/:id/merge_requests/:merge_request_id/cancel_merge_when_build_succeeds
PUT /projects/:id/merge_requests/:merge_request_id/cancel_merge_when_build_succeeds
```
```
...
@@ -670,11 +659,8 @@ Example response when an external issue tracker (e.g. JIRA) is used:
...
@@ -670,11 +659,8 @@ Example response when an external issue tracker (e.g. JIRA) is used:
## Subscribe to a merge request
## Subscribe to a merge request
Subscribes the authenticated user to a merge request to receive notification. If
Subscribes the authenticated user to a merge request to receive notification. If the user is already subscribed to the merge request, the
the operation is successful, status code `201` together with the updated merge
status code `304` is returned.
request is returned. If the user is already subscribed to the merge request, the
status code `304` is returned. If the project or merge request is not found,
status code `404` is returned.
```
```
POST /projects/:id/merge_requests/:merge_request_id/subscription
POST /projects/:id/merge_requests/:merge_request_id/subscription
...
@@ -747,10 +733,8 @@ Example response:
...
@@ -747,10 +733,8 @@ Example response:
## Unsubscribe from a merge request
## Unsubscribe from a merge request
Unsubscribes the authenticated user from a merge request to not receive
Unsubscribes the authenticated user from a merge request to not receive
notifications from that merge request. If the operation is successful, status
notifications from that merge request. If the user is
code `200` together with the updated merge request is returned. If the user is
not subscribed to the merge request, the status code `304` is returned.
not subscribed to the merge request, the status code `304` is returned. If the
project or merge request is not found, status code `404` is returned.