Restrict branch naming when new change matches with protection rules (#36405)

Resolves #36381 by only allowing admins to perform branch renames that
match to branch protection rules.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Kemal Zebari
2026-01-23 02:42:24 -08:00
committed by GitHub
parent e42a1dbb6b
commit 56c5d5e819
4 changed files with 45 additions and 3 deletions
+1 -1
View File
@@ -2663,7 +2663,7 @@
"repo.branch.new_branch_from": "Create new branch from \"%s\"",
"repo.branch.renamed": "Branch %s was renamed to %s.",
"repo.branch.rename_default_or_protected_branch_error": "Only admins can rename default or protected branches.",
"repo.branch.rename_protected_branch_failed": "This branch is protected by glob-based protection rules.",
"repo.branch.rename_protected_branch_failed": "Failed to rename branch due to branch protection rules.",
"repo.branch.commits_divergence_from": "Commit divergence: %[1]d behind and %[2]d ahead of %[3]s",
"repo.branch.commits_no_divergence": "The same as branch %[1]s",
"repo.tag.create_tag": "Create tag %s",