Fix bug the protected branch rule name is conflicted with renamed branch name#36650
Fix bug the protected branch rule name is conflicted with renamed branch name#36650lunny merged 5 commits intogo-gitea:mainfrom
Conversation
|
This comment was written by an AI assistant (Claude). The fix correctly prevents the Orphaned protection rule for the source branch: When renaming This means:
Should the orphaned if existingRule == nil || existingRule.ID == protectedBranch.ID {
protectedBranch.RuleName = to
if _, err = sess.ID(protectedBranch.ID).Cols("branch_name").Update(protectedBranch); err != nil {
return err
}
} else {
// Delete the old rule since the branch no longer exists and the target already has a rule
if _, err = sess.ID(protectedBranch.ID).Delete(&ProtectedBranch{}); err != nil {
return err
}
}Otherwise the fix itself is sound — the conflict check is correct and the test covers the right scenario. |
|
Does it mean that:
|
No. When |
|
Hmm, a second thought, why not just keep both Deleting something silently beyond user's knowledge seems strange to me. (Not blocker, it's up to you) |
|
* origin/main: Remove i18n backport tool at the moment because of translation format changed (go-gitea#36643) Fix bug the protected branch rule name is conflicted with renamed branch name (go-gitea#36650) Update JS deps (go-gitea#36656)
Fix #36464