Skip to content

5.0.2

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Nov 17:59
11becf2
fix(package): don't pop an unrelated stash during upgrade (#394)

git stash exits 0 with "No local changes to save" when the only
local change is an untracked file, without creating a new stash
entry. upgrade() treated that exit code alone as proof a stash was
created, so the later git stash pop could restore an unrelated,
pre-existing stash and recreate already-resolved conflicts on
subsequent updates.

Compare refs/stash before and after running git stash to confirm a
new entry actually exists before popping, and pop that specific
entry (stash@{0}) instead of relying on exit code alone. A
conflicting pop is now treated as a failed upgrade with an
actionable error message instead of only logging a warning.

Fixes #393