Git: `isRepositoryHuge` flag set during transient clone/checkout permanently freezes stale git status with no recovery short of restart
@lszomoru is already working on this.
Since Jun 22, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
When a git repository is re-cloned (or undergoes a large checkout) while a VS Code window is open on that workspace, VS Code's built-in git extension captures a transient, momentary state where all files appear as deleted (D). The git.statusLimit guard then permanently sets isRepositoryHuge = true, which freezes all subsequent git status refreshes — including manual "Refresh" from the Source Control panel — until VS Code is restarted.
Steps to Reproduce
- Open a large git repository (e.g., 10,000+ tracked files) in VS Code
- From the integrated terminal, delete the repo directory and re-clone it (e.g.,
rm -rf . && git clone <url> .) - Wait for the clone to complete
- Observe the Source Control panel — many files show as
D(deleted) even though they exist on disk - Click the "Refresh" button in Source Control — the stale
Ddecorations persist - Only restarting VS Code (or reloading the window) clears the stale state
Expected Behavior
After the clone completes and files are present on disk, VS Code should re-run git status and clear the stale D decorations — either automatically (once the transient state resolves) or at minimum when the user manually clicks "Refresh" in the Source Control panel.
Actual Behavior
- During the clone, the file watcher fires and triggers
git status -z - At that instant, all tracked files are missing from the working tree → git reports them all as deleted
git.statusLimit(default: 10,000) is hit, so only the first 10,000 entries are captured (early-alphabetical files like.config,Jenkinsfile,README, etc.)- The
didHitLimitflag setsisRepositoryHuge = true - From that point on, all file-watch events and manual refresh attempts are short-circuited by the huge-repository guard
- Stale
Dstate is frozen until the extension host restarts
Evidence from logs
The VS Code remote server log shows the file watcher shutting down during the re-clone:
[warning] [File Watcher (node.js)] Watcher shutdown because watched path got deleted
[warning] [File Watcher (node.js)] Watcher shutdown because watched path got deleted
[warning] [File Watcher (node.js)] Watcher shutdown because watched path got deleted
Root Cause
The isRepositoryHuge flag was designed to protect against repositories that persistently have an enormous number of changes (e.g., Linux kernel). However, it gets permanently set from a transient spike during clone/checkout — when the working tree is momentarily empty. Once set, there is no recovery path:
- ❌ Manual "Refresh" in Source Control → ignored (guard short-circuits)
- ❌ Subsequent file events → ignored
- ❌ Only a full window reload / extension host restart clears it
Suggested Fixes
Any of the following would resolve the issue:
- Re-evaluate
isRepositoryHuge: On the nextgit statuscall, if the result count is below the limit, resetisRepositoryHuge = falseso automatic refresh resumes. - Allow manual "Refresh" to bypass the guard: The user explicitly clicking "Refresh" should always trigger a fresh
git status, regardless of the huge-repo flag. - Detect transient clone state: If
.git/index.lockexists or.git/is rapidly changing, suppressgit statusuntil the operation settles — rather than capturing a snapshot of an incomplete working tree. - Increase default
git.statusLimitor make the limit configurable per-repository.
Environment
- VS Code: 1.123.0 (commit 6a44c352bd24569c417e530095901b649960f9f8)
- OS: RHEL 8.10 (Remote - SSH)
- Git: 2.x (shallow clone,
--depth 1) - Repository size: ~15 GB, ~74,000 tracked files, 150+ submodules
Workaround
Restart VS Code or reload the window (Developer: Reload Window). Alternatively, increase git.statusLimit in settings:
"git.statusLimit": 100000
Or close VS Code before performing large re-clones and reopen after completion.
- 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 ·