-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Description
Bug Description
When hiding repositories in the Source Control Repositories view, the visibility state is lost on restart — all repositories are shown again.
Steps to Reproduce
- Open a workspace with multiple git repositories
- In the Source Control Repositories view, deselect (hide) one or more repositories
- Close and reopen VS Code
- All repositories are visible again, ignoring the previous visibility selection
Expected Behavior
Repositories that were hidden before closing VS Code should remain hidden after restart.
Root Cause
The persistence mechanism exists (scm:view:visibleRepositories in workspace storage), but the restoration logic in SCMViewService.onDidAddRepository has two bugs:
-
isHiddenrepositories (e.g., Copilot worktrees) are not included in the savedallarray (because therepositoriesgetter filters them out). When they register on restart, they hit theindex === -1code path which makes ALL repos visible and resets thedidSelectRepositoryflag, destroying the entire restoration state. -
Genuinely new repositories (not present in the previous session) also trigger the
index === -1path, which makes all existing repos visible instead of only adding the new repo as visible.
Fix
- Skip the restoration logic for
isHiddenrepos — they should be tracked internally but not affect visibility restoration - For new repos not in previous state, add them as visible without changing existing repos' visibility
VS Code Version
main branch (1.112.0-dev)