Commit 2557225
git: discover worktrees when opening a worktree directory
When a worktree directory is opened with `git.detectWorktrees` enabled,
`checkForWorktrees()` previously returned early without discovering the
main repository or sibling worktrees. This left worktree management
commands non-functional because:
- Commands like "Create Worktree" filter for repository/submodule kind
- "Open Worktree" requires gitOpenRepositoryCount > 1
- SCM menu items depend on a repository-kind provider being open
Now, when a worktree is opened, `checkForWorktrees()` discovers and
opens sibling worktrees and the main repository (excluding the current
worktree from the candidate list). This enables the full worktree
management workflow regardless of which worktree is opened first.
The existing `isRepositoryOutsideWorkspace()` check already allows this
because it recognizes paths that appear in any open repository's worktree
list, and `getRepositoryExact()` prevents duplicate/recursive opens.
Also fixes a confusing log message that said detection "is not skipped"
when it was in fact skipping.
Fixes #264209
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 78e3397 commit 2557225
1 file changed
+9
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
817 | 818 | | |
818 | 819 | | |
819 | 820 | | |
820 | | - | |
| 821 | + | |
821 | 822 | | |
822 | 823 | | |
823 | 824 | | |
| |||
0 commit comments