mirror of
https://github.com/open-webui/computer.git
synced 2026-11-25 23:00:55 -05:00
refac
This commit is contained in:
1 parent
1a29822437
commit
5c0b4a6fcb
2 files changed
+55
-1
No files matched your search
@@ -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] = []
|
||||
|
||||
Reference in new issue
Block a user