This commit is contained in:
Timothy Jaeryang Baek committed 2026-07-09 23:22:43 -05:00
1 parent 1a29822437
commit 5c0b4a6fcb
2 files changed
+55 -1

No files matched your search

+6
View File
@@ -234,6 +234,12 @@ async def diff(
return _parse_diff(out)
async def staged_diff(root: str, max_chars: int = 30000) -> str:
"""Return the staged patch, capped for lightweight AI requests."""
_, out, _ = await _run("diff", "--staged", "--unified=3", cwd=root)
return out[:max_chars]
def _parse_diff(raw: str) -> dict[str, Any]:
"""Parse unified diff into structured format."""
files: list[dict] = []