fix(stacked-diffs): fix MR creation for forks
Description
#7574 (closed) has shown running stack sync will often create invalid MRs from a fork. This MR should fix it by checking for the head repo like glab create mr does and passing it as TargetProjectID to the create options.
Related Issues
Resolves #7574 (closed)
To test this:
Two scenarios:
- Create a new stack in a repo you have access to make MRs in (
glab stack new) - Change or add a file, use
glab stack save - Run
glab stack sync - Confirm an MR was created and has the changes you madde
- Make a fork of the project in Step 1 in a new directory
- Repeat the process, selecting the base as your original project that was forked
- Confirm that makes an MR as well
Screenshots (if appropriate):
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) -
Test gap
Edited by Gary Holtz is no longer with GitLab