(self, name: str)
| 349 | return "\n".join(lines) |
| 350 | |
| 351 | def status(self, name: str) -> str: |
| 352 | wt = self._find(name) |
| 353 | if not wt: |
| 354 | return f"Error: Unknown worktree '{name}'" |
| 355 | path = Path(wt["path"]) |
| 356 | if not path.exists(): |
| 357 | return f"Error: Worktree path missing: {path}" |
| 358 | r = subprocess.run( |
| 359 | ["git", "status", "--short", "--branch"], |
| 360 | cwd=path, |
| 361 | capture_output=True, |
| 362 | text=True, |
| 363 | timeout=60, |
| 364 | ) |
| 365 | text = (r.stdout + r.stderr).strip() |
| 366 | return text or "Clean worktree" |
| 367 | |
| 368 | def run(self, name: str, command: str) -> str: |
| 369 | dangerous = ["rm -rf /", "sudo", "shutdown", "reboot", "> /dev/"] |
no test coverage detected