Files
claude-config/bin/loop_claude/project/checkout.py
T
2026-11-18 16:21:35 +01:00

14 lines
340 B
Python

import pathlib
from failure import Failure
from loop_effects.effects import Effects
from agent_cycle.stop import Stop
def checkout_root(cwd: pathlib.Path, effects: Effects) -> str | Stop:
found = effects.git("rev-parse", "--show-toplevel", cwd=str(cwd))
return Stop(1, found.reason) if isinstance(found, Failure) else found.strip()