1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-17 14:18:15 +00:00

Rename UpdateBranch API to RenameBranch API (#35374)

Discussed in #35368, originally implemented in #32433
This commit is contained in:
Michal Suchánek
2025-09-01 16:12:05 +00:00
committed by GitHub
parent fd7ebaf427
commit ea96ff6b0c
6 changed files with 47 additions and 47 deletions

View File

@@ -380,11 +380,11 @@ func ListBranches(ctx *context.APIContext) {
ctx.JSON(http.StatusOK, apiBranches)
}
// UpdateBranch updates a repository's branch.
func UpdateBranch(ctx *context.APIContext) {
// swagger:operation PATCH /repos/{owner}/{repo}/branches/{branch} repository repoUpdateBranch
// RenameBranch renames a repository's branch.
func RenameBranch(ctx *context.APIContext) {
// swagger:operation PATCH /repos/{owner}/{repo}/branches/{branch} repository repoRenameBranch
// ---
// summary: Update a branch
// summary: Rename a branch
// consumes:
// - application/json
// produces:
@@ -408,7 +408,7 @@ func UpdateBranch(ctx *context.APIContext) {
// - name: body
// in: body
// schema:
// "$ref": "#/definitions/UpdateBranchRepoOption"
// "$ref": "#/definitions/RenameBranchRepoOption"
// responses:
// "204":
// "$ref": "#/responses/empty"
@@ -419,7 +419,7 @@ func UpdateBranch(ctx *context.APIContext) {
// "422":
// "$ref": "#/responses/validationError"
opt := web.GetForm(ctx).(*api.UpdateBranchRepoOption)
opt := web.GetForm(ctx).(*api.RenameBranchRepoOption)
oldName := ctx.PathParam("*")
repo := ctx.Repo.Repository