1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-18 13:44:27 +00:00
Kemal Zebari 2483a93fbc
Only allow admins to rename default/protected branches (#33276)
Currently, anyone with write permissions to a repo are able to rename
default or protected branches.

This change follows
[GitHub's](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/renaming-a-branch)
design by only allowing repo/site admins to change these branches.
However, it also follows are current design for protected branches and
only allows admins to modify branch names == branch protection rule
names. Glob-based rules cannot be renamed by anyone (as was already the
case, but we now catch `ErrBranchIsProtected` which we previously did
not catch, throwing a 500).
2025-01-15 20:51:49 +00:00
..
2025-01-12 03:39:46 +00:00
2025-01-15 11:15:47 +08:00
2025-01-15 11:15:47 +08:00
2024-12-26 11:56:03 +08:00
2025-01-12 03:39:46 +00:00
2024-12-24 13:47:45 +00:00
2024-06-19 06:32:45 +08:00
2024-12-29 01:05:56 +00:00
2025-01-10 06:00:06 +00:00
2024-12-30 01:57:38 +00:00
2025-01-12 03:39:46 +00:00
2025-01-13 16:27:11 +08:00
2025-01-14 15:35:34 +08:00
2024-05-03 09:13:48 +00:00
2025-01-12 03:39:46 +00:00
2024-12-30 01:57:38 +00:00