Check if the dev branch exists before moving to it.

This commit is contained in:
2025-10-15 06:42:16 -07:00
parent 8dfb3fe2a6
commit 8445b64d6b

View File

@@ -928,8 +928,17 @@
git ls-remote --heads | sort
if [[ "$base" != "dev" ]]; then
echo -e "\n* Switching back to dev."
git switch dev
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
echo -e "\n* Switching back to dev."
git switch dev
elif [[ "$dev_exists" == 2 ]]; then
echo -e "\n* Switching back to main."
git switch main
else
echo "*** ERROR: Unknown status for dev_exists, '$dev_exists'. ***"
fi
fi
echo -e "\n* Verifying which branch we're on."