You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using wt inside a git submodule, wt switch navigates to .git/modules/<submodule>/ instead of the actual submodule working directory.
Reproduction steps
Have a parent repository with submodules:
parent-repo/
├── .git/
│ └── modules/
│ └── my-submodule/ # git internal data
└── my-submodule/ # actual working directory
cd into the submodule and create a worktree:
cd parent-repo/my-submodule
wt switch -c feature/test
3. From the new worktree, switch back to main:
wt switch main
4. Expected: Shell navigates to parent-repo/my-submodule/
5. Actual: Shell navigates to parent-repo/.git/modules/my-submodule/
Cause
Git submodules store their actual git data in the parent repo's .git/modules/<name>/ directory. The submodule's .git is a file containing:
gitdir: ../../.git/modules/my-submodule
It seems wt resolves the primary worktree path using this gitdir reference, which points to the internal git data directory rather than the submodule's working directory.Environment- worktrunk: v0.24.1- git: 2.49.0- OS: macOS---
Activity
fix: correct `list_worktrees()` path for submodule main worktree (#1069)
fix: correct list_worktrees() path for submodule main worktree (max-s…