summaryrefslogtreecommitdiff
path: root/doc/api/merge_requests.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/merge_requests.md')
-rw-r--r--doc/api/merge_requests.md72
1 files changed, 43 insertions, 29 deletions
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 0c06cfcd876..130488bf7c1 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -923,6 +923,48 @@ Example response:
"created_at": "2016-07-26T14:44:48.926Z",
"merge_request_id": 105,
"state": "collected",
+ "real_size": "1"
+}, {
+ "id": 108,
+ "head_commit_sha": "3eed087b29835c48015768f839d76e5ea8f07a24",
+ "base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
+ "start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
+ "created_at": "2016-07-25T14:21:33.028Z",
+ "merge_request_id": 105,
+ "state": "collected",
+ "real_size": "1"
+}]
+```
+
+## Get a single MR diff version
+
+Get a single merge request diff version.
+
+```
+GET /projects/:id/merge_requests/:merge_request_id/versions/:version_id
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ------- | -------- | --------------------- |
+| `id` | String | yes | The ID of the project |
+| `merge_request_id` | integer | yes | The ID of the merge request |
+| `version_id` | integer | yes | The ID of the merge request diff version |
+
+```bash
+curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/1/merge_requests/1/versions/1
+```
+
+Example response:
+
+```json
+{
+ "id": 110,
+ "head_commit_sha": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
+ "base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
+ "start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
+ "created_at": "2016-07-26T14:44:48.926Z",
+ "merge_request_id": 105,
+ "state": "collected",
"real_size": "1",
"commits": [{
"id": "33e2ee8579fda5bc36accc9c6fbd0b4fefda9e30",
@@ -959,33 +1001,5 @@ Example response:
"renamed_file": false,
"deleted_file": false
}]
-}, {
- "id": 108,
- "head_commit_sha": "3eed087b29835c48015768f839d76e5ea8f07a24",
- "base_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
- "start_commit_sha": "eeb57dffe83deb686a60a71c16c32f71046868fd",
- "created_at": "2016-07-25T14:21:33.028Z",
- "merge_request_id": 105,
- "state": "collected",
- "real_size": "1",
- "commits": [{
- "id": "3eed087b29835c48015768f839d76e5ea8f07a24",
- "short_id": "3eed087b",
- "title": "Add license",
- "author_name": "Administrator",
- "author_email": "admin@example.com",
- "created_at": "2016-07-25T17:21:20.000+03:00",
- "message": "Add license"
- }],
- "diffs": [{
- "old_path": "LICENSE",
- "new_path": "LICENSE",
- "a_mode": "0",
- "b_mode": "100644",
- "diff": "--- /dev/null\n+++ b/LICENSE\n@@ -0,0 +1,21 @@\n+The MIT License (MIT)\n+\n+Copyright (c) 2016 Administrator\n+\n+Permission is hereby granted, free of charge, to any person obtaining a copy\n+of this software and associated documentation files (the \"Software\"), to deal\n+in the Software without restriction, including without limitation the rights\n+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+copies of the Software, and to permit persons to whom the Software is\n+furnished to do so, subject to the following conditions:\n+\n+The above copyright notice and this permission notice shall be included in all\n+copies or substantial portions of the Software.\n+\n+THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+SOFTWARE.\n",
- "new_file": true,
- "renamed_file": false,
- "deleted_file": false
- }]
-}]
+}
```