Commit 526927c
fix(sling): use polecat path from creation instead of re-computing
When spawning a polecat via `gt sling`, the code was discarding the
return value from AddWithOptions()/RepairWorktreeWithOptions() and then
calling Get() to retrieve the polecat object. This caused Get() to
re-compute the clone path using os.Stat() checks, which fails for remote
rigs where the worktree exists on a remote machine but not locally.
This fix:
1. Uses the return value from AddWithOptions()/RepairWorktreeWithOptions()
directly instead of calling Get() afterwards
2. Passes the correct ClonePath to the session manager via WorkDir option,
ensuring the session starts in the right directory
This ensures consistency between worktree creation and session startup,
fixing the issue where polecats would get "not a git repository" errors
when the os.Stat() fallback logic chose the wrong path.
Fixes: gt-job89
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent d78e70c commit 526927c
1 file changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | | - | |
| 105 | + | |
| 106 | + | |
100 | 107 | | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
105 | | - | |
| 112 | + | |
| 113 | + | |
106 | 114 | | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
| |||
0 commit comments