fix: fetch all remote branches before checkout on reinstall

Single-branch clones only track one branch. Reset the remote refspec
to '*' before fetching so any target branch can be checked out.

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

View File

@@ -431,6 +431,7 @@ if [[ -d "$INSTALL_DIR/.git" ]]; then
# safe.directory nötig wenn das Verzeichnis einem anderen User gehört
# (z.B. ripster-Serviceuser nach erstem Install)
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" checkout --quiet -B "$GIT_BRANCH" "origin/$GIT_BRANCH"
git -C "$INSTALL_DIR" reset --hard "origin/$GIT_BRANCH"