cmd/update.sh: check initial branch is not master

Check that the initial branch is not 'master' before doing a forced update on 'master'. Git will fail with fatal error otherwise.
This commit is contained in:
Darren Kavanagh 2024-05-08 13:53:10 -07:00
parent 21e130056a
commit 85cd2f075e
No known key found for this signature in database
GPG Key ID: A258D1E837E3C689

View File

@ -266,7 +266,8 @@ EOS
then
git checkout --force "${UPSTREAM_BRANCH}" "${QUIET_ARGS[@]}"
else
if [[ -n "${UPSTREAM_TAG}" && "${UPSTREAM_BRANCH}" != "master" ]]
if [[ -n "${UPSTREAM_TAG}" && "${UPSTREAM_BRANCH}" != "master" ]] &&
[[ "${INITIAL_BRANCH}" != "master" ]]
then
git branch --force "master" "origin/master" "${QUIET_ARGS[@]}"
fi