From 391458ce49c337b6d6b9ebd3d06c3060dffa92e0 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 24 Jun 2026 15:10:02 +0200 Subject: [PATCH] Improve branch checkout fallback in update-Nitrov3.sh Add fallback logic to try capitalized branch name if the specified branch is not found, with a clear error message if neither exists. --- update-Nitrov3.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/update-Nitrov3.sh b/update-Nitrov3.sh index 47edd9e..5b6697b 100755 --- a/update-Nitrov3.sh +++ b/update-Nitrov3.sh @@ -244,7 +244,15 @@ git_update() { git stash --include-untracked || true local old_head old_head=$(git rev-parse HEAD) - git checkout "$branch" + if ! git checkout "$branch" 2>/dev/null; then + local alt="${branch^}" + if [ "$alt" != "$branch" ] && git checkout "$alt" 2>/dev/null; then + info "Branch '$branch' not found, using '$alt' instead" + branch="$alt" + else + die "Branch '$branch' (or '$alt') not found in $repo" + fi + fi git pull [ "$(git rev-parse HEAD)" != "$old_head" ] }