fix(merger): de-dupe race-rescue against primary stash path set
The race-rescue loop was firing on every merger run because `git add -A && git stash create` does not clean the working tree — files stay dirty post-stash, so a subsequent `snapshotDirtyFiles` saw the SAME paths the primary stash had just captured and stashed them again, producing identical-tree race-rescue duplicates (visible in git stash list as `fusion-merger-autostash:FN-XXXX:race-rescue-0` sitting next to its identical `fusion-merger-autostash:FN-XXXX:`). Fix: list the path set captured by the primary stash via `git stash show --name-only`, and only rescue paths in the current dirty snapshot that are NOT in that set — those are genuine late-dirty writes from concurrent dev edits or interleaved ops. Also drop any rescue whose tree-SHA exactly equals the primary, as a defensive belt-and-braces. Existing duplicate race-rescue stashes are harmless (identical content to their primaries) and can be dropped manually. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/merger-rescue-dedup.md
Normal file
5
.changeset/merger-rescue-dedup.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Fix race-rescue stash duplicating the primary autostash. `git add -A && git stash create` registers a stash commit but does not clean the working tree, so the rescue loop's subsequent `snapshotDirtyFiles` saw the same files the primary stash already captured and stashed them again on every merger run. Now the rescue diffs current dirty paths against the primary stash's recorded path set and only rescues paths that weren't already captured, plus a tree-SHA equality check that drops any rescue whose tree exactly matches the primary.
|
||||
Reference in New Issue
Block a user