Prevent creating a MR on a non-existing branch using API
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "feature" label: - https://gitlab.com/gitlab-org/cli/-/issues/?label_name%5B%5D=type%3A%3Afeature and verify the issue you're about to submit isn't a duplicate. ---> ### Problem to solve Creating a MR from an existing branch to a non-existing branch proceeds successfully in the CLI, while the web interface displays an error message. <!-- What problem do we solve? Try to define the who/what/why of the opportunity as a user story. For example, "As a (who), I want (what), so I can (why/value)." --> ### Proposal Check whether the MR's target branch exists on the project's repository, and prevent users from creating merge requests on non-existing branches. <!-- How are we going to solve the problem? --> ### Further details This issue is loosely related to https://gitlab.com/gitlab-org/cli/-/issues/979 ```bash ➜ glab-mr-to-non-existing-branch git:(main) glab mr create -b develop ? Choose a template Open a blank merge request ? Title: this is a test ? Description <Received> ? What's next? Submit Creating merge request for main into develop in william-atyos/glab-mr-to-non-existing-branch !1 this is a test (main) https://gitlab.com/william-atyos/glab-mr-to-non-existing-branch/-/merge_requests/1 ``` __glab version :__ `glab version 1.34.0 (2023-10-21)` <!-- Include examples, use cases, benefits, goals, or any other details that will help us understand the problem better. --> ### Links / references See this MR for reference : https://gitlab.com/william-atyos/glab-mr-to-non-existing-branch/-/merge_requests/1
issue