Repository navigation
stash: create snapshot after index refresh - #1019
Closed
Tyrie Vella (tyrielv) wants to merge 2 commits into
Closed
Tyrie Vella (tyrielv) wants to merge 2 commits into
Tyrie Vella (tyrielv) wants to merge 2 commits into
Conversation
Tyrie Vella (tyrielv)
force-pushed
the
merge-stash-failed-vfs
branch
from
October 30, 2026 17:23
841b6b2 to
74d34d2
Compare
"git stash create" can find a tracked change in its first quick check, then observe different worktree or virtual-filesystem state after refreshing the index. Rechecking the old in-memory index can either report no object or miss changes made by post-index-change. After the refresh and hook complete, clear the filesystem and VFS caches, reload the index, and validate that tracked paths can be stated. Once the initial check requested a stash, create a snapshot from that fresh state even if only stat data changed. This returns a normal stash object instead of an ambiguous exit status. Make quiet refresh report unexpected stat errors. Reload merge's parent index after the stash child so later strategy writes do not restore stale index state. Existing stash and autostash callers continue to consume the normal object-ID contract. Assisted-by: Claude Opus 4.8 Assisted-by: GPT-5.6 Sol Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Add stash-create tests for three post-index-change outcomes: a stat-only change produces a clean-tree snapshot, a content change is captured, and a VFS path-list update exposes and captures a newly modified path. Add merge coverage for the normal save-state caller. Add an autostash case that forces the parent and child refreshes separately, proving that autostash creates and consumes the snapshot produced after the race. Assisted-by: GPT-5.6 Sol Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Tyrie Vella (tyrielv)
force-pushed
the
merge-stash-failed-vfs
branch
from
October 30, 2026 18:21
74d34d2 to
ccdf338
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and Context
git stash createfirst uses a quick worktree check. It then refreshes theindex before creating the stash object. File or virtual-filesystem state can
change between those steps.
The command currently rechecks the old in-memory index after the refresh. That
can report no object for a stat-only race or miss a worktree change made from
post-index-change. Callers such asgit mergethen either abort or continuewithout a complete snapshot.
Changes
the index, and validate access to tracked paths.
state even when only stat data changed.
writes do not restore stale index state.