summaryrefslogtreecommitdiff
path: root/doc/api/commits.md
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2018-02-13 20:22:37 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2018-02-14 10:16:34 +0100
commita724f7e35f9f8ed9692b0f3f4d6c8a62632cdec4 (patch)
tree07c821347130287119ad58dd4fe07e1a0552370b /doc/api/commits.md
parent922d156a5e0412a12662df94e03479f7ed015f7b (diff)
downloadgitlab-ce-a724f7e35f9f8ed9692b0f3f4d6c8a62632cdec4.tar.gz
Refactor commits/refs API to use hash and add pagination headers
Diffstat (limited to 'doc/api/commits.md')
-rw-r--r--doc/api/commits.md15
1 files changed, 9 insertions, 6 deletions
diff --git a/doc/api/commits.md b/doc/api/commits.md
index 18d31ffe24d..2c745d00887 100644
--- a/doc/api/commits.md
+++ b/doc/api/commits.md
@@ -203,6 +203,7 @@ Example response:
> [Introduced][ce-15026] in GitLab 10.6
Get all references (from branches or tags) a commit is pushed to.
+The pagination parameters `page` and `per_page` can be used to restrict the list of references.
```
GET /projects/:id/repository/commits/:sha/refs
@@ -214,20 +215,22 @@ Parameters:
| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
| `sha` | string | yes | The commit hash |
-| `type` | string | no | The scope of commits. Possible values `branches`, `tags`, `all`. Default is `all`. |
+| `type` | string | no | The scope of commits. Possible values `branch`, `tag`, `all`. Default is `all`. |
```bash
-curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" --form "type=all" "https://gitlab.example.com/api/v4/projects/5/repository/commits/5937ac0a7beb003549fc5fd26fc247adbce4a52e/refs"
+curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/5/repository/commits/5937ac0a7beb003549fc5fd26fc247adbce4a52e/refs?type=all"
```
Example response:
```json
[
- {"branch_name": "'test'"},
- {"branch_name": "master"},
- {"tag_name": "v1.1.0"}
-]
+ {"type": "branch", "name": "'test'"},
+ {"type": "branch", "name": "add-balsamiq-file"},
+ {"type": "branch", "name": "wip"},
+ {"type": "tag", "name": "v1.1.0"}
+ ]
+
```
## Cherry pick a commit