microsoft / git

A fork of Git containing Microsoft-specific patches.
http://git-scm.com/
Other
782 stars 92 forks source link

Git reset --mixed HEAD~1 does not leave modified files in working tree #646

Closed rossnichols closed 4 months ago

rossnichols commented 6 months ago

Setup

$ git --version --build-options

git version 2.45.0.vfs.0.0
cpu: x86_64
built from commit: b68812e6facef46153bdeb3d79c1b8f353b8e94d
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon

Are you using Scalar or VFS for Git?

VFS for Git.

$ gvfs version

GVFS 1.0.24074.1
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.26203.5000]

The repo is the Windows monorepo

Details

PowerShell via Terminal Windows app

# on a fresh clone of the Windows monorepo
git reset --mixed head~1

I expected the files modified by the most recent commit to be moved to the "unstaged" status.

Running git status reported that the working tree was clean. Note that if I had instead run git reset --soft head~1, the files would have correctly been put into the staged state. Subsequently running git reset --mixed head would trigger the repro, though.

This seems very similar to #490. @derrickstolee FYI.