Skip to content

Add functional test for reset --mixed skip-worktree bug (depends on microsoft/git#935)#2018

Draft
tyrielv wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-reset-mixed-skipworktree
Draft

Add functional test for reset --mixed skip-worktree bug (depends on microsoft/git#935)#2018
tyrielv wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/fix-reset-mixed-skipworktree

Conversation

@tyrielv

@tyrielv tyrielv commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Functional test for reset --mixed skip-worktree bug

Adds ReproResetMixedSkipWorktree to CorruptionReproTests. This test validates the fix in microsoft/git#935.

Bug

After git reset --mixed HEAD~N, hydrated files (read via blame/cat-file but not modified) retained skip-worktree because git's update_index_from_diff() only cleared it for files not on disk. Hydrated files were invisible to git status after the reset.

Test

On the FunctionalTests/20201014 branch, Readme.md is the only file that differs between HEAD and HEAD~1:

  1. blame Readme.md — hydrates the file (ProjFS materializes on disk, not in ModifiedPaths)
  2. reset HEAD~1 — should report M Readme.md in output

Without the git fix: GVFS repo reports 223 files, control reports 224 (Readme.md missing).
With the git fix: both report 224.

Dependencies

Adds ReproResetMixedSkipWorktree to CorruptionReproTests. The test
hydrates Readme.md via blame (materializes on disk but not in
ModifiedPaths, so skip-worktree stays set), then runs reset HEAD~1.

On the FunctionalTests/20201014 branch, Readme.md is the only file
that differs between HEAD and HEAD~1. The control repo correctly
reports it as modified after the reset; the GVFS repo does not because
skip-worktree hides the working-tree vs index mismatch.

This test is expected to FAIL until the fix is applied.

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant