diff --git a/scripts/install.sh b/scripts/install.sh index 166d984fa..a2e81c15c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -752,7 +752,11 @@ clone_repo() { if [ "$restore_now" = "yes" ]; then log_info "Restoring local changes..." if git stash apply "$autostash_ref"; then - git stash drop "$autostash_ref" >/dev/null + local autostash_drop_ref + autostash_drop_ref="$(git stash list --format='%gd %H' | awk -v sha="$autostash_ref" '$2 == sha {print $1; exit}')" + if [ -n "$autostash_drop_ref" ]; then + git stash drop "$autostash_drop_ref" >/dev/null + fi log_warn "Local changes were restored on top of the updated codebase." log_warn "Review git diff / git status if Hermes behaves unexpectedly." else