MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / status

Method status

agents/s12_worktree_task_isolation.py:351–366  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

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/"]

Callers 1

Calls 3

_findMethod · 0.95
existsMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected