Closed jstoneham closed 1 year ago
:+1: to getting this change landed. We just spent the morning trying to figure out why mob
kept pushing the newly created branch on top of origin/master
and it came down to having push.default = tracking
.
Hi @jstoneham, sorry for my late reply. This is a nice find and I look forward to merge your PR to fix it. Would you be able to write a test for the behavior you expected but didn't occur?
I'll try. Sorry to report I'm on vacation at the moment but if I find some time!
Oh! Enjoy your vacation 😃. No rush!
Please take a look at the new test. This test failed before I applied my change. I also did some more testing and removed some of the changes as only the single line is necessary to solve the case I was having trouble with.
Thank you very much, @jstoneham !
Users who have the Git config push.default=tracking, or other values, will have different default behavior on 'git push'.
Example: a newly created mob branch from
origin/mainline
is trackingorigin/mainline
until--set-upstream
takes effect. The originalgit push
, which is intended to push toorigin/mob/mainline
, will actually push themob start
commit toorigin/mainline
ifpush.default=tracking
.To avoid this scenario, we will always specify the remote ref we are pushing to.