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.39.0.windows.2
cpu: x86_64
built from commit: e7d4c504802f93f5914ed48944ced4e593bcaf6c
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.19042.1165]
- What options did you set as part of the installation? Or did you choose the
defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt
Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: LFOnly
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Enabled
Enable FSMonitor: Enabled
- Any other interesting things about your environment that might be related
to the issue you're seeing?
No.
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.
# Case 1
cd /c/
rm -rf foo
git init foo
scalar register foo
scalar list
# We can see the enlistment "C:/foo"
scalar unregister /c/foo
scalar list
# The enlistment "C:/foo" is gone from the list.
# Case 2
cd /c/
rm -rf foo
git init foo
scalar register foo
scalar list
# We can see the enlistment "C:/foo"
scalar unregister foo
scalar list
# The enlistment "C:/foo" is gone from the list.
# Case 3
cd /c/
rm -rf foo
git init foo
scalar register foo
scalar list
# We can see the enlistment "C:/foo"
rm -rf foo
scalar unregister foo
scalar list
# The enlistment "C:/foo" is gone from the list.
# Case 4
cd /c/
rm -rf foo
git init foo
scalar register foo
scalar list
# We can see the enlistment "C:/foo"
rm -rf foo
scalar unregister /c/foo
scalar list
# The enlistment "C:/foo" is still in the list.
- What did you expect to occur after running these commands?
In Case 1, we can unregister an enlistment with its absolute path if the path exists.
In Case 2, we can unregister an enlistment with its relative path if the path exists.
In Case 3, we can unregister an enlistment with its relative path even if the path has been removed by rm -rf
.
In Case 4, we cannot unregister an enlistment with its absolute path if the path has been removed by rm -rf
. The enlistment is expected to be unregistered. So far as I've tried, in order to unregister it, we have to re-create the path first, by mkdir -p /c/foo
or git init /c/foo
. As in Case 3, we can also use its relative path.
- What actually happened instead?
The command scalar unregister /c/foo
does not unregister the enlistment C:/foo
which has been removed by rm -rf
.
- If the problem was occurring with a specific repository, can you provide the
URL to that repository to help us with testing?
It's not occurring with a specific repository.