Commit 9d68dff
fix(switch): resolve main worktree path from worktree list instead of repo root (#79)
GetRepoRoot() uses `git rev-parse --show-toplevel` which returns the
current worktree's root, not the main repo root. This caused `ss main`
to resolve to the wrong path when run from a worktree.
Use `git worktree list` for all branches uniformly, which always returns
the correct path.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent eeecb86 commit 9d68dff
2 files changed
Lines changed: 9 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 101 | | |
113 | 102 | | |
114 | 103 | | |
| |||
150 | 139 | | |
151 | 140 | | |
152 | 141 | | |
153 | | - | |
| 142 | + | |
154 | 143 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 144 | + | |
| 145 | + | |
158 | 146 | | |
159 | | - | |
160 | 147 | | |
161 | 148 | | |
162 | 149 | | |
163 | 150 | | |
164 | | - | |
| 151 | + | |
165 | 152 | | |
166 | 153 | | |
167 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
44 | | - | |
| 42 | + | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | | - | |
71 | | - | |
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
| |||
0 commit comments