Restrict branch naming when new change matches with protection rules#36405
Merged
silverwind merged 5 commits intogo-gitea:mainfrom Jan 23, 2026
Merged
Restrict branch naming when new change matches with protection rules#36405silverwind merged 5 commits intogo-gitea:mainfrom
silverwind merged 5 commits intogo-gitea:mainfrom
Conversation
kemzeb
commented
Jan 18, 2026
| "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.", |
Member
Author
There was a problem hiding this comment.
Made this change as this error may cover both static and glob-based protection rules.
wxiaoguang
reviewed
Jan 19, 2026
silverwind
approved these changes
Jan 22, 2026
lunny
approved these changes
Jan 23, 2026
silverwind
added a commit
to silverwind/gitea
that referenced
this pull request
Jan 23, 2026
* origin/main: Bugfix: Potential incorrect runID in run status update (go-gitea#36437) Restrict branch naming when new change matches with protection rules (go-gitea#36405) Refactor GetRepoRawDiffForFile to avoid unnecessary pipe or goroutine (go-gitea#36434)
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Jan 26, 2026
* giteaofficial/main: Normalize guessed languages for code highlighting (go-gitea#36450) Add `knip` linter (go-gitea#36442) Fix various bugs (go-gitea#36446) Update tool dependencies (go-gitea#36445) Update JS dependencies, adjust webpack config, misc fixes (go-gitea#36431) fix: Improve image captcha contrast for dark mode (go-gitea#36265) Refactor template render (go-gitea#36438) Add documentation for markdown anchor post-processing (go-gitea#36443) Fix markup heading parsing, fix emphasis parsing (go-gitea#36284) Front port changelog for 1.25.4 (go-gitea#36432) Bugfix: Potential incorrect runID in run status update (go-gitea#36437) Restrict branch naming when new change matches with protection rules (go-gitea#36405)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #36381 by only allowing admins to perform branch renames that match to branch protection rules.