fix(graalvm): track new remote branches

This commit is contained in:
darksaid98 committed 2025-07-13 11:58:12 +02:00
1 parent fe1dba18d2
commit 0aac4595c4
1 file changed
+10 -3
+10 -3
View File
@@ -109,6 +109,15 @@ perform_git_update() {
# Check if we have a shallow clone
local is_shallow=$(git rev-parse --is-shallow-repository 2>/dev/null || echo "false")
# Switch branches if necessary
local current_branch=$(git branch --show-current 2>/dev/null || echo "")
# Check if we need to switch branches
if [ "$current_branch" != "$branch" ]; then
echo "Adding remote branch reference for '$branch'..."
git remote set-branches --add origin "$branch"
fi
# Fetch based on whether it's shallow or not
if [ "$is_shallow" = "true" ]; then
echo "Detected shallow repository, fetching with depth 1..."
@@ -120,9 +129,6 @@ perform_git_update() {
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'..."
@@ -137,6 +143,7 @@ perform_git_update() {
fi
# Deploy changes
echo "Updating local files to match remote branch..."
git reset --hard "origin/$branch"
# Get latest commit info for logging