Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/merge_request_context_commits.md')
-rw-r--r--doc/api/merge_request_context_commits.md31
1 files changed, 20 insertions, 11 deletions
diff --git a/doc/api/merge_request_context_commits.md b/doc/api/merge_request_context_commits.md
index 26fb561e5e7..b277b9147b5 100644
--- a/doc/api/merge_request_context_commits.md
+++ b/doc/api/merge_request_context_commits.md
@@ -55,29 +55,38 @@ Parameters:
|---------------------|---------|----------|-------------|
| `id` | integer | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) owned by the authenticated user |
| `merge_request_iid` | integer | Yes | The internal ID of the merge request. |
+| `commits` | string array | Yes | The context commits' SHAs. |
-```plaintext
-POST /projects/:id/merge_requests/
+Example request:
+
+```shell
+curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
+ --header 'Content-Type: application/json' \
+ --data '{"commits": ["51856a574ac3302a95f82483d6c7396b1e0783cb"]}' \
+ --url "https://gitlab.example.com/api/v4/projects/15/merge_requests/12/context_commits"
```
-| Attribute | Type | Required | Description |
-| --------- | ---- | -------- | ----------- |
-| `commits` | string array | Yes | The context commits' SHA. |
+Example response:
```json
[
{
- "id": "6d394385cf567f80a8fd85055db1ab4c5295806f",
- "message": "Added contributing guide\n\nSigned-off-by: Example User <user@example.com>\n",
+ "id": "51856a574ac3302a95f82483d6c7396b1e0783cb",
+ "short_id": "51856a57",
+ "created_at": "2014-02-27T10:05:10.000+02:00",
"parent_ids": [
- "1a0b36b3cdad1d2ee32457c102a8c0b7056fa863"
+ "57a82e2180507c9e12880c0747f0ea65ad489515"
],
- "authored_date": "2014-02-27T10:05:10.000+02:00",
+ "title": "Commit title",
+ "message": "Commit message",
"author_name": "Example User",
"author_email": "user@example.com",
- "committed_date": "2014-02-27T10:05:10.000+02:00",
+ "authored_date": "2014-02-27T10:05:10.000+02:00",
"committer_name": "Example User",
- "committer_email": "user@example.com"
+ "committer_email": "user@example.com",
+ "committed_date": "2014-02-27T10:05:10.000+02:00",
+ "trailers": {},
+ "web_url": "https://gitlab.example.com/project/path/-/commit/b782f6c553653ab4e16469ff34bf3a81638ac304"
}
]
```