fix(graalvm): allow branch switching

This commit is contained in:
darksaid98 committed 2025-07-13 11:36:53 +02:00
1 parent 1a7aed6eff
commit fe1dba18d2
1 file changed
+18
+18
View File
@@ -119,6 +119,24 @@ perform_git_update() {
fi
echo "Updating local files to match remote branch..."
# Switch branches if necessary
local current_branch=$(git branch --show-current 2>/dev/null || echo "")
if [ "$current_branch" != "$branch" ]; then
echo "Switching from branch '$current_branch' to '$branch'..."
# Check if local branch exists
if git show-ref --verify --quiet "refs/heads/$branch"; then
echo "Local branch '$branch' exists, checking out..."
git checkout "$branch"
else
echo "Creating and checking out new local branch '$branch'..."
git checkout -b "$branch" "origin/$branch"
fi
fi
# Deploy changes
git reset --hard "origin/$branch"
# Get latest commit info for logging