This commit is contained in:
Timothy Jaeryang Baek committed 2026-08-13 15:54:43 -06:00
1 parent 9451874f17
commit 7745cb7205
10 files changed
+2233 -104

No files matched your search

+16
View File
@@ -324,6 +324,22 @@ async def diff(
return _parse_diff(out)
async def compare_diff(
root: str,
base: str,
head: str,
ignore_whitespace: bool = False,
identity: ExecutionIdentity | None = None,
) -> dict[str, Any]:
"""Get a structured diff for a base...head comparison."""
args = ["diff", "--unified=3", "--color=never"]
if ignore_whitespace:
args.append("--ignore-all-space")
args.append(f"{base}...{head}")
_, out, _ = await _run(*args, cwd=root, identity=identity)
return _parse_diff(out)
async def staged_diff(
root: str, max_chars: int = 30000, identity: ExecutionIdentity | None = None
) -> str: