Ensure the stable branch is checked out before pulling in migrate.sh
The checkout would be a no-op if already on stable (git would print Already on 'stable' but importantly would not return a failing exit code). It would fail if the user has local changes, but if they have local changes git pull would also fail, so there's no change there.
Update boot.sh to avoid 'detached HEAD' state when not necessary
Instead of checking out FETCH_HEAD, which always puts the user in 'detached HEAD' state, we will check out ${OMAKUB_REF:-stable} so that we only end up in 'detached HEAD' state when necessary (i.e. when checking out a SHA rather than a branch).
This is a follow-up to https://github.com/basecamp/omakub/pull/187 with the following changes:
Ensure the stable branch is checked out before pulling in
migrate.sh
The checkout would be a no-op if already on
stable
(git would printAlready on 'stable'
but importantly would not return a failing exit code). It would fail if the user has local changes, but if they have local changesgit pull
would also fail, so there's no change there.Update
boot.sh
to avoid 'detached HEAD' state when not necessaryInstead of checking out
FETCH_HEAD
, which always puts the user in 'detached HEAD' state, we will check out${OMAKUB_REF:-stable}
so that we only end up in 'detached HEAD' state when necessary (i.e. when checking out a SHA rather than a branch).