On 15/03/2018 17:52, Junio C Hamano wrote: > > > Hi, I ran into what I believe is a bug today. I’m using primarily Git > > for Windows 2.16.2 and also reproduced the behavior on Git for Windows > > 2.15.1 and Git 2.14.1 on Ubuntu: > > > > Given any repository with at least one subdirectory: > > > > 1. Create some untracked files in the subdir > > 2. Modify a tracked file in the subdir > > 3. Execute `git stash push subdir` > > 4. The untracked files will be removed, without warning. > > > > `git stash push` behaves as-expcted and does not touch untracked > > files. It’s only when a directory tree is specified as [pathspec] > > that the problem occurs. > > I wonder if this is the same as the topic on this thread. > > https://public-inbox.org/git/CA+HNv10i7AvWXjrQjxxy1LNJTmhr7LE4TwxhHUYBiWtmJCOf_A@xxxxxxxxxxxxxx/ > > What is curious is that the fix bba067d2 ("stash: don't delete > untracked files that match pathspec", 2018-01-06) appeared first in > 2.16.2, on which Windows 2.16.2 is supposed to be built upon. > > > Here's the precise reproduction case executed on a linux box: > > This does not reproduce for me with v2.16.2-17-g38e79b1fda (the tip > of 'maint'); I do not have an install of vanilla v2.16.2 handy, but > I suspect v2.16.2 would work just fine, too. > > > jake@jake-VirtualBox:~/woot$ git --version > > git version 2.14.1 > > ... > > The expected result is that when I do `ls subdir` the file > > "untracked.txt" still exists. Alternatively, git stash should warn me > > before destroying my untracked files, and require I specify --force or > > similar to invoke destructive behavior. I can't seem to reproduce this on 2.16.2.windows.1, either: + git --version git version 2.16.2.windows.1 + git init woot Initialized empty Git repository in /woot/.git/ + cd woot + mkdir subdir + echo test + echo test + git add meh.txt subdir/meh2.txt + git commit '--message=stash bug testing' [master (root-commit) afec47d] stash bug testing 2 files changed, 2 insertions(+) create mode 100644 meh.txt create mode 100644 subdir/meh2.txt + git commit '--message=stash bug testing' On branch master nothing to commit, working tree clean + echo test + echo append + git stash push subdir Saved working directory and index state WIP on master: afec47d stash bug testing + ls subdir meh2.txt untracked.txt Regards, Buga