mirror of
https://github.com/open-webui/computer.git
synced 2026-11-26 07:11:02 -05:00
refac
This commit is contained in:
1 parent
9451874f17
commit
7745cb7205
10 files changed
+2233
-104
No files matched your search
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user