mirror of
https://github.com/darksaid98/yolks.git
synced 2026-12-04 06:29:00 +00:00
fix(graalvm): allow branch switching
This commit is contained in:
1 file changed
+18
@@ -119,6 +119,24 @@ perform_git_update() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updating local files to match remote branch..."
|
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"
|
git reset --hard "origin/$branch"
|
||||||
|
|
||||||
# Get latest commit info for logging
|
# Get latest commit info for logging
|
||||||
|
|||||||
Reference in new issue
Block a user