Skip to content

Git: deleted closed-repository folders are stuck in workspaceState #313551

@eamodio

Description

@eamodio

Once a repository is added to the git extension's closedRepositories workspace-state set, there is no way to remove the entry if the repo's folder is later deleted on disk. The "previously closed repositories" notification keeps reappearing, git.closedRepositoryCount stays positive, and clicking Reopen → All Repositories silently does nothing for the dead path. The only current workaround is editing state.vscdb by hand.

Version: 1.119.0-insider (user setup)
Commit: 7e4091cc0c2607b3445c2c05b74b940e68e61413
Date: 2026-04-29T21:38:10-07:00
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26300

Steps to Reproduce

  1. Open a workspace containing two git repos, e.g. ~/tmp/repoA and ~/tmp/repoB (git init each).
  2. In the Source Control view, right-click repoAClose Repository.
  3. Quit the VS Code window.
  4. On disk: rm -rf ~/tmp/repoA.
  5. Reopen the workspace. The "Git repositories were found that were previously closed" notification appears.
  6. Click Reopen → pick All Repositories (or pick the dead repoA entry directly).

Expected

The dead repoA entry is dropped from the closed-repositories set; the notification disappears; git.closedRepositoryCount becomes 0.

Actual

Nothing visible happens. The entry remains in workspaceState.closedRepositories, the notification reappears on every workspace open, and there is no UI affordance to forget the entry.

Will open a PR.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions