mirror of
https://github.com/open-webui/computer.git
synced 2026-11-23 14:10:45 -05:00
refac
This commit is contained in:
1 parent
e46db91f04
commit
049280219b
6 files changed
+206
-7
No files matched your search
+3
-1
@@ -8,6 +8,7 @@ from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
|
||||
@@ -130,9 +131,10 @@ async def diff(
|
||||
"""Get diff output as structured data."""
|
||||
if untracked and file:
|
||||
# Untracked files: use --no-index to diff against empty
|
||||
null_device = "NUL" if sys.platform == "win32" else "/dev/null"
|
||||
_, out, _ = await _run(
|
||||
"diff", "--no-index", "--unified=3",
|
||||
"--", "/dev/null", file,
|
||||
"--", null_device, file,
|
||||
cwd=root, check=False,
|
||||
)
|
||||
return _parse_diff(out)
|
||||
|
||||
Reference in new issue
Block a user