mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
format with gofumpt (#18184)
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
This commit is contained in:
@@ -177,23 +177,18 @@ func CreateBranch(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
err := repo_service.CreateNewBranch(ctx, ctx.User, ctx.Repo.Repository, opt.OldBranchName, opt.BranchName)
|
||||
|
||||
if err != nil {
|
||||
if models.IsErrBranchDoesNotExist(err) {
|
||||
ctx.Error(http.StatusNotFound, "", "The old branch does not exist")
|
||||
}
|
||||
if models.IsErrTagAlreadyExists(err) {
|
||||
ctx.Error(http.StatusConflict, "", "The branch with the same tag already exists.")
|
||||
|
||||
} else if models.IsErrBranchAlreadyExists(err) || git.IsErrPushOutOfDate(err) {
|
||||
ctx.Error(http.StatusConflict, "", "The branch already exists.")
|
||||
|
||||
} else if models.IsErrBranchNameConflict(err) {
|
||||
ctx.Error(http.StatusConflict, "", "The branch with the same name already exists.")
|
||||
|
||||
} else {
|
||||
ctx.Error(http.StatusInternalServerError, "CreateRepoBranch", err)
|
||||
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -532,7 +527,6 @@ func CreateBranchProtection(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
ctx.JSON(http.StatusCreated, convert.ToBranchProtection(bp))
|
||||
|
||||
}
|
||||
|
||||
// EditBranchProtection edits a branch protection for a repo
|
||||
|
Reference in New Issue
Block a user