Disambiguate 'git checkout release' in install.sh

The tracked release/ directory collides with the release branch name, so a
bare `git checkout release` is ambiguous ("could be both a local file and a
tracking branch") and aborts a fresh install. Use `checkout -B <branch>
origin/<branch>`, which can never be parsed as a path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Roland 2026-06-27 13:57:27 -06:00
parent cafc6514cb
commit bf88ac9f33
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680

View file

@ -56,7 +56,9 @@ set -e
apt install -y git
git --version
git clone https://github.com/lrnselfreliance/wrolpi.git /opt/wrolpi || :
(cd /opt/wrolpi && git fetch && git checkout "${BRANCH}" && git reset --hard origin/"${BRANCH}") || exit 4
# Use `checkout -B <branch> origin/<branch>` so the ref can never be mistaken for a path. A tracked `release/`
# directory otherwise collides with the `release` branch name, making a bare `git checkout release` ambiguous.
(cd /opt/wrolpi && git fetch && git checkout -B "${BRANCH}" "origin/${BRANCH}" && git reset --hard origin/"${BRANCH}") || exit 4
if [ ${rpi} == true ]; then
/opt/wrolpi/scripts/install_raspberrypios.sh 2>&1 | tee /opt/wrolpi/install.log