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
path: root/doc
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-02-22 14:47:13 +0300
committerRémy Coutable <remy@rymai.me>2017-02-22 14:47:13 +0300
commit87411889b9c8a778bebafeaa381e1d736af7329a (patch)
tree338e2628a8b7b95572fb1bacf3ea8b8272c3929c /doc
parent99d0bc3d5521785f14330ef8cb2160c2bececeee (diff)
parentc79bbe26ab1e16facddaf159d4d074937586d742 (diff)
Merge branch '22132-rename-branch-name-params-to-branch' into 'master'
Standardize branch name params as `branch` on V4 API Closes #22132 See merge request !8936
Diffstat (limited to 'doc')
-rw-r--r--doc/api/branches.md4
-rw-r--r--doc/api/commits.md4
-rw-r--r--doc/api/repository_files.md24
-rw-r--r--doc/api/v3_to_v4.md6
4 files changed, 22 insertions, 16 deletions
diff --git a/doc/api/branches.md b/doc/api/branches.md
index 5eaa8d2e920..765ca439720 100644
--- a/doc/api/branches.md
+++ b/doc/api/branches.md
@@ -193,11 +193,11 @@ POST /projects/:id/repository/branches
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer | yes | The ID of a project |
-| `branch_name` | string | yes | The name of the branch |
+| `branch` | string | yes | The name of the branch |
| `ref` | string | yes | The branch name or commit SHA to create branch from |
```bash
-curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/5/repository/branches?branch_name=newbranch&ref=master"
+curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/5/repository/branches?branch=newbranch&ref=master"
```
Example response:
diff --git a/doc/api/commits.md b/doc/api/commits.md
index eaab3e0df3d..18bc2873678 100644
--- a/doc/api/commits.md
+++ b/doc/api/commits.md
@@ -69,7 +69,7 @@ POST /projects/:id/repository/commits
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `id` | integer/string | yes | The ID of a project or NAMESPACE/PROJECT_NAME |
-| `branch_name` | string | yes | The name of a branch |
+| `branch` | string | yes | The name of a branch |
| `commit_message` | string | yes | Commit message |
| `actions[]` | array | yes | An array of action hashes to commit as a batch. See the next table for what attributes it can take. |
| `author_email` | string | no | Specify the commit author's email address |
@@ -87,7 +87,7 @@ POST /projects/:id/repository/commits
```bash
PAYLOAD=$(cat << 'JSON'
{
- "branch_name": "master",
+ "branch": "master",
"commit_message": "some commit message",
"actions": [
{
diff --git a/doc/api/repository_files.md b/doc/api/repository_files.md
index dbb3c1113e8..677e209ccd9 100644
--- a/doc/api/repository_files.md
+++ b/doc/api/repository_files.md
@@ -46,22 +46,22 @@ POST /projects/:id/repository/files
```
```bash
-curl --request POST --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch_name=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20content&commit_message=create%20a%20new%20file'
+curl --request POST --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20content&commit_message=create%20a%20new%20file'
```
Example response:
```json
{
- "file_path": "app/project.rb",
- "branch_name": "master"
+ "file_name": "app/project.rb",
+ "branch": "master"
}
```
Parameters:
- `file_path` (required) - Full path to new file. Ex. lib/class.rb
-- `branch_name` (required) - The name of branch
+- `branch` (required) - The name of branch
- `encoding` (optional) - Change encoding to 'base64'. Default is text.
- `author_email` (optional) - Specify the commit author's email address
- `author_name` (optional) - Specify the commit author's name
@@ -75,22 +75,22 @@ PUT /projects/:id/repository/files
```
```bash
-curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch_name=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file'
+curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file'
```
Example response:
```json
{
- "file_path": "app/project.rb",
- "branch_name": "master"
+ "file_name": "app/project.rb",
+ "branch": "master"
}
```
Parameters:
- `file_path` (required) - Full path to file. Ex. lib/class.rb
-- `branch_name` (required) - The name of branch
+- `branch` (required) - The name of branch
- `encoding` (optional) - Change encoding to 'base64'. Default is text.
- `author_email` (optional) - Specify the commit author's email address
- `author_name` (optional) - Specify the commit author's name
@@ -113,22 +113,22 @@ DELETE /projects/:id/repository/files
```
```bash
-curl --request DELETE --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch_name=master&author_email=author%40example.com&author_name=Firstname%20Lastname&commit_message=delete%20file'
+curl --request DELETE --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v3/projects/13083/repository/files?file_path=app/project.rb&branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&commit_message=delete%20file'
```
Example response:
```json
{
- "file_path": "app/project.rb",
- "branch_name": "master"
+ "file_name": "app/project.rb",
+ "branch": "master"
}
```
Parameters:
- `file_path` (required) - Full path to file. Ex. lib/class.rb
-- `branch_name` (required) - The name of branch
+- `branch` (required) - The name of branch
- `author_email` (optional) - Specify the commit author's email address
- `author_name` (optional) - Specify the commit author's name
- `commit_message` (required) - Commit message
diff --git a/doc/api/v3_to_v4.md b/doc/api/v3_to_v4.md
index 2dd8886ab97..59d7f0634b2 100644
--- a/doc/api/v3_to_v4.md
+++ b/doc/api/v3_to_v4.md
@@ -31,3 +31,9 @@ changes are in V4:
- Moved `PUT /users/:id/(block|unblock)` to `POST /users/:id/(block|unblock)`
- Make subscription API more RESTful. Use `post ":project_id/:subscribable_type/:subscribable_id/subscribe"` to subscribe and `post ":project_id/:subscribable_type/:subscribable_id/unsubscribe"` to unsubscribe from a resource.
- Labels filter on `projects/:id/issues` and `/issues` now matches only issues containing all labels (i.e.: Logical AND, not OR)
+- Renamed param `branch_name` to `branch` on the following endpoints
+ - POST `:id/repository/branches`
+ - POST `:id/repository/commits`
+ - POST/PUT/DELETE `:id/repository/files`
+- Renamed `branch_name` to `branch` on DELETE `id/repository/branches/:branch` response
+