(repo: string, wtPath: string)
| 130 | const wtPath = worktreePath(name); |
| 131 | const ref = worktreeRef(name); |
| 132 | const attached = { branch: ref, path: wtPath, name }; |
| 133 | if (existsSync(wtPath)) { |
| 134 | // Attach only to a real linked worktree (the `.git` pointer file). A leftover or |
| 135 | // corrupt dir must NOT silently become a non-isolated cwd — fail fast instead. |
| 136 | if (existsSync(path.join(wtPath, '.git'))) return attached; |
| 137 | throw new Error(`worktree path exists but is not a git worktree: ${wtPath}`); |
no outgoing calls
no test coverage detected