fix: reset hard before branch switch to discard stale local changes

Partial writes from a failed install leave files as "local changes",
blocking the checkout. Reset to HEAD first so the switch always works.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-12 08:09:11 +00:00
parent d8a6b4c56d
commit 871e39bba2

View File

@@ -433,6 +433,7 @@ if [[ -d "$INSTALL_DIR/.git" ]]; then
git config --global --add safe.directory "$INSTALL_DIR" 2>/dev/null || true
git -C "$INSTALL_DIR" remote set-branches origin '*'
git -C "$INSTALL_DIR" fetch --quiet origin
git -C "$INSTALL_DIR" reset --hard HEAD
git -C "$INSTALL_DIR" checkout --quiet -B "$GIT_BRANCH" "origin/$GIT_BRANCH"
git -C "$INSTALL_DIR" reset --hard "origin/$GIT_BRANCH"
ok "Repository aktualisiert auf Branch '$GIT_BRANCH'"