-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
When parallel checkout is enabled, Git checkout and related commands error out.
#1442 produces similar error messages but is probably not related to parallel checkout.
Setup
- Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options
git version 2.36.1.windows.1
cpu: x86_64
built from commit: e2ff68a2d1426758c78d023f863bfa1e03cbc768
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
- 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.19044.1766]
- What options did you set as part of the installation? Or did you choose the
defaults?
$ cat /etc/install-options.txt
Editor Option: VisualStudioCode
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Rebase
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Enabled
Enable FSMonitor: Disabled
- Any other interesting things about your environment that might be related
to the issue you're seeing?
I've enabled parallel checkout:
git config checkout.workers 8
Details
- Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
Bash
- 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.
# I Use CPython just as an example.
$ git clone https://github.com/python/cpython.git --depth=1
$ cd cpython
# Just for test purposes. I change the working dir in a significant way,
# so that we have something to restore.
$ rm -rf Lib
# When I enable parallel checkout, the following restore will fail.
# The exact number does not matter.
# The bug does not appear with just a single checkout worker process.
$ git config checkout.workers 8
$ git restore Lib
Unlink of file 'Lib' failed. Should I try again? (y/n)
$ git checkout -- Lib
Unlink of file 'Lib/ctypes' failed. Should I try again? (y/n)
- What did you expect to occur after running these commands?
No failure to restore the working directory: all removed files restored.
- What actually happened instead?
A failure to to restore the working directory "Unlink of file '...' failed". The exact directory from the error message varies per invocation, i.e., is not fully predicable.
This was only observable on three independent Windows 10 machines. I could not identify any third party SW that could be related to this issue. I could not reproduce on Linux (Raspbian, Fedora). Windows Defender is active, but disabling it did not affect this issue.
The error message does not show up during sequential checkout, that is, with Git config option checkout.workers =1
.