Code change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: N/A, extensions are required. <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --Version: 1.74.0 (user setup) Commit: Date: 2022-12-05T16:38:16.075Z Electron: 19.1.8 Chromium: 102.0.5005.167 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0. Sandboxed: No Steps to Reproduce: a network UNC based workspace with a GIT repository that is not currently marked safe. the process to mark the repository safe via the new feature. The repository still will not work. Looking at the .gitconfig file will show that the UNC path was to the safe directory list without the needed prefix.
do you mind sharing the exact output when running inside the unsafe repository as well as the exact path that is being to the file? I am asking as we are currently extracting the path from the output of the command so the issue could be upstream. Thank you!
Here is an example ... I've removed details such as the SID's for security: Note the suggested command to add the path to the safe.directory list includes the needed prefix, but its possible that this is something specific to 'Git for Windows'? This is my personal documents folder via Folder Redirection, its stored on a network path, and since I am the systems administrator, my files are all owned by the administrator, thus ALL my repositories no matter where they are, are considered unsafe. :(
thank you very much! I was extracting the path from the first line of the output which is not correct. Will work on a fix.
You might also note, GIT seems to also flip back and forth as to whether the server in the UNC path should be all capitalized or all lowercase. Don't know if it is something VSCode is doing that causes that, but it can change its mind between two sessions even though the case of the path doesn't change from what I can see in VSCode. This causes an already marked safe repository to be marked unsafe, which is exactly what happened here.
could you please expand on that? Are you seeing this casing issue in the git output window or VS Code UI?
Depends on where you look. So far today, VSCode's Explorer is indicating the path's server portion as uppercase and the source control is also reporting the server portion as uppercase (hover over a repository), so they are agreeing, but next week or next month, it will switch and they won't agree, and it usually is GIT that has changed, not what VSCode shows in the Explorer view. (Explorer view) ! (source control view) ! I've been trying to track this down for a long while, and now the safe-repository mechanism also gets tripped up in this.
thanks for the example. I would suggest that you keep an eye out for any discrepancies on the casing of the path and file a separate issue when it occurs again. As far as this particular issue goes, the fix will be available with the Insiders release next week.

Related discussion:
text: constructor(public readonly repository: Repository, public readonly index: number) { } } <del> class UnsafeRepositorySet extends Set<string> { </del> <ins> /** * Key   - normalized path used in user interface * Value - path extracted from the output of the `git status` command *         used when calling `git config --global --add safe.directory` */ class UnsafeRepositoryMap extends Map<string, string> { </ins> constructor() { super(); this.updateContextKey(); } <del> override add(value: string): this { const result = super.add(value); </del> <ins> override set(key: string, value: string): this { const result = super.set(key, value); </ins> this.updateContextKey(); return result; } <del> override delete(value: string): boolean { const result = super.delete(value); </del> <ins> override delete(key: string): boolean { const result = super.delete(key); </ins> this.updateContextKey(); return result;