mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Disambiguate 'git checkout release' in upgrade.sh.
Same fix install.sh received in bf88ac9f: on a box with no local
release branch (installed before that patch), the tracked release/
directory makes a bare `git checkout -f release` fail with
"could be both a local file and a tracking branch", aborting upgrades.
`checkout -f -B <branch> origin/<branch>` is unambiguous and already
resets the branch to origin, replacing the separate reset --hard.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
e8c6d8415b
commit
e6ace5942b
1 changed files with 4 additions and 3 deletions
|
|
@ -119,9 +119,10 @@ fi
|
|||
|
||||
# Signature verified, safe to apply.
|
||||
# Force the checkout so local working-tree changes (e.g. app/package-lock.json
|
||||
# rewritten by npm install during a prior upgrade) cannot abort the switch; the
|
||||
# following reset --hard discards them anyway.
|
||||
(cd /opt/wrolpi && git checkout -f "${BRANCH}" && git reset --hard origin/"${BRANCH}") || exit 4
|
||||
# rewritten by npm install during a prior upgrade) cannot abort the switch.
|
||||
# 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 checkout -f -B "${BRANCH}" "origin/${BRANCH}") || exit 4
|
||||
|
||||
# Verify HEAD again after checkout in case the branch was swapped between fetch and checkout.
|
||||
if ! git -C /opt/wrolpi verify-commit HEAD 2>&1; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue