-
Notifications
You must be signed in to change notification settings - Fork 715
Description
Bug Report
When a git worktree is created inside a repository's root folder and then removed, the PR sidebar retains a stale entry for that worktree. The refresh button does not clear it — only a full window reload removes it.
Additionally, active PRs stop showing under the main repo entry. Expanding sections like "All Open" or "Created By Me" returns nothing, even though open PRs exist. The PR list remains broken until a full window reload.
Steps to Reproduce
- Open a repository in VS Code
- Create a worktree inside the repo root (e.g.,
git worktree add worktrees/review-77 origin/task/75) - The extension detects the worktree and adds a separate repo entry in the Pull Requests sidebar
- Remove the worktree (
git worktree remove worktrees/review-77) - Optionally remove the now-empty
worktrees/directory - Click the Refresh button in the Pull Requests sidebar
Expected Behavior
- The stale worktree entry should be removed from the sidebar after refresh
- Active PRs should continue to show under the main repo entry
Actual Behavior
- The stale entry remains in the sidebar
- PRs stop appearing under the main repo — all categories show empty
- Only
Developer: Reload Windowrestores normal behavior
Context
This is related to the worktree handling introduced in #7896 / PR #7900. The fix correctly filters worktrees not in workspace folders, but repo detection appears to be cached for the lifetime of the window — removed worktrees are never evicted, and the presence of the stale entry breaks PR listing for the actual repository.
Environment
- VS Code: latest
- GitHub Pull Requests extension: latest (post-February 2026)
- OS: macOS