fix(mr create --related-issue): use specified title and description
Description
Previously, the following commands would ignore the given title and description and use the title from the issue, and overwrite description with Closes #<id>.
glab mr create --related-issue <id> --title foo --description barglab mr create -i <id> --title foo --description bar
With this change, --title is used if also passed alongside --related-issue rather than the issue title. Closes #<id> is appended to the description rather than overwriting --description.
Also while writing tests for this I had to fix #1117 (closed) which caused all MRs to be set to draft even when --draft wasn't passed.
Related Issues
Closes #1117 (closed) Closes #1110 (closed)
How has this been tested?
There were no tests for related issues so I had to add the following:
Added two new tests:
TestNewCmdCreate_RelatedIssueWithTitle
TestNewCmdCreate_RelatedIssueDraft
Screenshots (if appropriate):
| test | screenshot |
|---|---|
| Related issue as draft | ![]() |
| Related issue | ![]() |
| Related issue with title and description | ![]() |
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms)
Edited by Jay McCure


