FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
84 stars 47 forks source link

mdk fix when both a master and main branch exists picks the wrong branch #224

Closed andrewnicols closed 6 months ago

andrewnicols commented 6 months ago

I've got a few cases where I'm gradually moving code over as I modify issues.

Given I have the following branches:

What actually happens is that I am prompted to switch to the -master variant instead. When I choose n, then it checks out my existing main branch:

➜  sm git:(MDL-59467-main) mdk fix 80072
/opt/homebrew/bin/git show-ref --verify --quiet refs/remotes/origin/main
/opt/homebrew/bin/git remote -v
/opt/homebrew/bin/git config --get remote.origin.url
/opt/homebrew/bin/git show-ref --verify --quiet refs/heads/MDL-80072-master
  It seems like you already have an existing working branch (MDL-80072-master).
  Would you like to check this out instead? (y/n) n
/opt/homebrew/bin/git show-ref --verify --quiet refs/heads/MDL-80072-main
/opt/homebrew/bin/git checkout MDL-80072-main
Branch MDL-80072-main checked out