Implemented push options merge request MR from master to another branch

What does this MR do and why?

This change modifies how merge requests are handled when pushing to the default branch. Previously, the system would always skip creating merge requests when pushing to the default branch. Now, it will only skip the default branch if no target branch is specified in the push options. This allows users to create merge requests from the default branch by explicitly specifying a target branch. The change includes new tests that verify both scenarios: when pushing from the default branch with a target specified (should create a merge request) and without a target specified (should do nothing, maintaining the original behavior).

References

Screenshots or screen recordings

The Screenshot shows the new created MR after the git push -o merge_request.create -o merge_request.target=other command. Screenshot_2025-04-16_at_10.47.55

How to set up and validate locally

  1. Take any repository with master and other branches.
  2. Switch to master.
  3. Make any changes and commit them.
  4. Run git push -o merge_request.create -o merge_request.target=other

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #214123 (closed)

Merge request reports

Loading