mirror of
https://github.com/go-gitea/gitea
synced 2025-08-12 04:28:21 +00:00
Fix adding branch as protected to not allow pushing to it (#2556)
* Fix adding branch as protected to not allow pushing to it * Fix can_push value to false in protected_branch (#2560) * Fix integration test
This commit is contained in:
@@ -520,7 +520,7 @@ func ProtectedBranchPost(ctx *context.Context) {
|
||||
|
||||
canPush := ctx.QueryBool("canPush")
|
||||
|
||||
if canPush {
|
||||
if !canPush {
|
||||
if err := ctx.Repo.Repository.AddProtectedBranch(branchName, canPush); err != nil {
|
||||
ctx.Flash.Error(ctx.Tr("repo.settings.add_protected_branch_failed", branchName))
|
||||
ctx.JSON(200, map[string]string{
|
||||
|
Reference in New Issue
Block a user