Closed
Description
Setup
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.25.0.windows.1
cpu: x86_64
built from commit: 7c71c859c97853ed057da5cbab12f3c13b5554df
sizeof-long: 4
sizeof-size_t: 8
- Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver
Microsoft Windows [Version 10.0.18363.592]
- What options did you set as part of the installation? Or did you choose the
defaults?
Portable Git
Details
- Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
CMD
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
First, let's create a repo with a file inside a folder:
mkdir repro
cd repro
git init
mkdir folder
touch folder\file
Then, place the following bug.js
node.js script at the root of the repo:
const cp = require('child_process');
const path = require('path');
const filePath = path.join(__dirname, 'folder', 'file');
// replace this with wherever you have git 2.25
const git = 'C:\\Users\\joao\\Downloads\\PortableGit-2.25\\bin\\git.exe';
cp.spawnSync(git, ['clean', '-f', '-q', '--', filePath], { cwd: __dirname });
Then simply run it:
node bug.js
Just like @eamodio in #2478, I am shelling out to git
via spawn
. This works on 2.24. Doesn't work any more on 2.25.
Can't repro if the target file is at the root of the repository.
- What did you expect to occur after running these commands?
I expect the file to be deleted from disk.
- What actually happened instead?
Nothing happens.