Push Options in forked repositories always create a MR in the upstream repository instead of fork
Summary
When I use the »Push Options« to create a Merge Request from CLI (Docs https://docs.gitlab.com/ee/user/project/push_options.html, introduced in gitlab-foss!26752 (merged)) in a forked repository, then GitLab will always create the MR against the original repository. Selecting the fork is not possible.
Steps to reproduce
- Create repository (“upstream”)
- Fork repository (“fork”)
- Create a feature branch
- Add new commit in fork repository
- Push using »push options«
git push -o merge_request.create -o merge_request.target=main
What is the current bug behavior?
A MR is created with source branch »feature-branch in fork-repository« and target branch »main in upstream-repository«
This behavior fits the typical use case for forks.
But I want to create a MR within the fork. This doesn't work.
What is the expected correct behavior?
In the GitLab UI I have the possibility to select a target project and then a target branch.
In the push option I can't select the project. I expect the push option to let me set the target project as well.
Results of GitLab environment info
GitLab 12
Possible fixes
If the option to select a project exists → Add a documentation.
If the option to select a project is missing → Add the feature.