regro / rever

Releaser of Versions
https://regro.github.io/rever-docs/
BSD 3-Clause "New" or "Revised" License
74 stars 34 forks source link

FIX: try git checkout $VERSION before git checkout -b $VERSION master #124

Closed justcalamari closed 5 years ago

justcalamari commented 6 years ago

The idea here is that when you git clone a repo, there will only be a master branch locally, so git checkout -b $VERSION master will not fail. If there is a $VERSION branch on origin, though, git checkout $VERSION will create a local branch that tracks the $VERSION branch on origin. If origin has no $VERSION branch, git checkout $VERSION will fail and git checkout -b $VERSION master will run instead, creating a new branch.

scopatz commented 6 years ago

Hi @justcalamari there an API to check if branches exist without checking it out, which is I think what you are trying to do. I would suggest adding a function to do this check to vcsutils.xsh. Thanks for putting this in!