fix(install): use stash@{0} instead of git rev-parse refs/stash for autostash recovery

Autostash creates refs/stash as a pointer to the latest stash commit, but
git stash apply/drop expect the symbolic ref format like stash@{0}, not
the raw commit SHA. Using the commit SHA causes: error: 'X is not a stash reference'
This commit is contained in:
Jwd-gity 2026-05-12 18:45:20 -07:00 committed by Teknium
parent dd1d4e9c5d
commit 327b8cee9e

View file

@ -890,7 +890,7 @@ clone_repo() {
stash_name="hermes-install-autostash-$(date -u +%Y%m%d-%H%M%S)" stash_name="hermes-install-autostash-$(date -u +%Y%m%d-%H%M%S)"
log_info "Local changes detected, stashing before update..." log_info "Local changes detected, stashing before update..."
git stash push --include-untracked -m "$stash_name" git stash push --include-untracked -m "$stash_name"
autostash_ref="$(git rev-parse --verify refs/stash)" autostash_ref="stash@{0}"
fi fi
git fetch origin git fetch origin