Bug: Wrong upstream set
Steps to reproduce:
Preparation:
- Fresh repo:
git init git add -all git commit -a -m "Initial commit" git push --set-upstream https://gitlab.com/example_group/example_subgroup/example_project.git master - Create and switch to a new branch named
betatracking the current:git switch --track --create beta git push --set-upstream https://gitlab.com/example_group/example_subgroup/example_project.git beta - Same as above but this time the new branch is named
alpha:git switch --track --create alpha git push --set-upstream https://gitlab.com/example_group/example_subgroup/example_project.git alpha - Browse to the project on GitLab.
- Create an issue.
- Create a merge request using that issue, and select the
alphabranch as source branch.
I have already done the above at @trimoon-inc/system/archiso_setup
The bug:
- Pull the project on your machine to get the updates.
git pull - Grab that merge request using your util.
git mr 1 - Check the configured
mergevalue in your cloned repo of this new branch.
If you cloned the repo I prepared, it will showrefs/heads/1-improve-alpha-version\nHEAD\nalpha\nbeta\nmasterwhich is wrong😉 - It should be
refs/heads/1-improve-alpha-version
Note the\nHEAD\nalpha\nbeta\nmasterat end of the wrong value👍
Evidence of bad value:
You won't be able to check the status of the branch relative to the upstream using git status
Edited by Elan Ruusamäe