Add ability to reset branch-level squash settings to project defaults
What does this MR do and why?
This MR adds the ability to reset branch-level squash settings to inherit from project defaults, resolving issue #575818.
Previously, when a squash setting was configured on a specific branch rule, there was no way to remove that configuration and revert to using the project-level default setting. Users had to either:
- Remove and recreate the branch protection (leaving the branch unprotected temporarily)
- Manually set the branch-level value to match the project setting (breaking inheritance)
Screenshots or screen recordings
| before | after |
|---|---|
|
|
|
|
How to set up and validate locally
- Navigate to a project's Settings > Repository > Branch rules
- Create or edit a branch rule (not "All branches", not a branch rule using wildcards)
- Configure a squash setting for the branch rule
- Edit the squash settings again - you should now see a "Default" option
- Select "Default" and save - this will remove the branch-level override and inherit from project settings
- Verify the branch rule no longer shows a specific squash setting but inherits from project level
Note: The "Default" option is intentionally not available for the "All branches" rule since that rule defines the project-level defaults.
Why "Default" option is not available for "All branches"
The "All branches" rule defines the project-level default squash settings.
Issue #575818
Edited by Jacques Erasmus



