mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 10:17:37 +02: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:
1 parent
f014e42a06
commit
25e71ad41e
7 files changed
+34
-16
No files matched your search
@@ -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