Files
claude-config/bin/loop_claude/project/checkout.py
T

14 lines
339 B
Python

import pathlib
from failure import Failure
from loop_claude.effects import Effects
from loop_claude.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()