Git: getRepositoryExact loops infinitely with ENOENT error after workspace folder rename
@lszomoru is already working on this.
Since Jun 23, 2026.
Assessment
This issue has not been assessed yet.
Description
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.125.1 (user setup)
- Commit: fcf604774b9f2674b473065736ee75077e256353
- Date: 2026-06-19T08:39:34Z
- Electron: 42.2.0
- ElectronBuildId: 14159160
- Chromium: 148.0.7778.97
- Node.js: 24.15.0
- V8: 14.8.178.14-electron.0
- OS Version: Windows_NT x64 10.0.26200
Steps to Reproduce:
- Open a project located in a directory (e.g.,
e:\aaa\bbb) that is initialized as a Git repository. - Rename the project's root folder using Windows File Explorer.
- Open the newly renamed folder in VS Code and delete its
.gitfolder to stop version control tracking. - The built-in Git extension crashes into an infinite, high-frequency loop running
git rev-parse --show-toplevel. - The Git output channel constantly spams thousands of lines saying
fatal: not a git repository (or any of the parent directories): .git. - Immediately following, the extension model spams warnings:
[warning] [Model][getRepositoryExact] Failed to get repository realpath for: ... Error: ENOENT: no such file or directory, realpath. - Even if you reset workspace profiles, use
Developer: Reset State, reload windows, close the folder completely, or temporarily rename the folder back to its original name, the internal path state remains desynchronized. If renamed back, it instead loops complaining that the "new" name cannot be found viaENOENT.
Git Log Output Sample:
2026-06-23 10:11:34.479 [info] > git rev-parse --show-toplevel [29ms]
2026-06-23 10:11:34.479 [info] fatal: not a git repository (or any of the parent directories): .git
2026-06-23 10:11:35.423 [warning] [Model][getRepositoryExact] Failed to get repository realpath for: "e:\aaa\bbb". Error:Error: ENOENT: no such file or directory, realpath 'e:\aaa\bbb'
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.9k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
new release
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
testplan-item
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
All issues in microsoft/vscode
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·