From 96e640b33c96cc41d3e98029479fcd7d37cd21a3 Mon Sep 17 00:00:00 2001 From: Yury Kossakovsky Date: Wed, 14 May 2025 14:20:51 -0600 Subject: [PATCH] Enhance update script with git reset functionality - Added a git reset --hard HEAD command to the update.sh script to ensure a clean working directory before pulling the latest changes. This helps prevent issues caused by uncommitted local changes during updates, while also logging a warning if the reset fails. --- scripts/update.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/update.sh b/scripts/update.sh index 7d2a3cc..8f3023c 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -36,6 +36,7 @@ if ! command -v git &> /dev/null; then else # Change to project root for git pull cd "$PROJECT_ROOT" || { log_error "Failed to change directory to $PROJECT_ROOT"; exit 1; } + git reset --hard HEAD || { log_warning "Failed to reset repository. Continuing update with potentially unreset local changes..."; } git pull || { log_warning "Failed to pull latest repository changes. Continuing update with potentially old version of apply_update.sh..."; } # Change back to script dir or ensure apply_update.sh uses absolute paths or cd's itself # (apply_update.sh already handles cd to PROJECT_ROOT, so we're good)