[API] Add branch delete (#11112)

* use same process as in routers/repo/branch.go/deleteBranch

* make sure default branch can not be deleted

* remove IsDefaultBranch from UI process - it is worth its own pull

* permissions
This commit is contained in:
6543 2020-04-19 04:38:09 +02:00 committed by GitHub
parent 0ef11ff2c9
commit 3c5a4d094a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 157 additions and 0 deletions

View file

@ -2269,6 +2269,47 @@
"$ref": "#/responses/Branch"
}
}
},
"delete": {
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Delete a specific branch from a repository",
"operationId": "repoDeleteBranch",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "string",
"description": "branch to delete",
"name": "branch",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"$ref": "#/responses/empty"
},
"403": {
"$ref": "#/responses/error"
}
}
}
},
"/repos/{owner}/{repo}/collaborators": {