repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
Mirrored from https://github.com/yingqi-z20/Agent-libOS
stars
latest
clone command
git clone gitlawb://did:key:z6MkqRzA...RfoM/yingqi-z20-Agen...git clone gitlawb://did:key:z6MkqRzA.../yingqi-z20-Agen...d98dd2c9IPC1d ago| #2 |
| #3 | from pathlib import Path |
| #4 |
| #5 | from agent_libos.primitives.shell import ShellAdapter |
| #6 |
| #7 |
| #8 | class GitAdapter: |
| #9 | def __init__(self, shell: ShellAdapter): |
| #10 | self.shell = shell |
| #11 |
| #12 | def status(self, pid: str) -> str: |
| #13 | return self.shell.run(pid, ["git", "status", "--short"]).stdout |
| #14 |
| #15 | def diff(self, pid: str, path: str | Path | None = None) -> str: |
| #16 | argv = ["git", "diff"] |
| #17 | if path is not None: |
| #18 | argv.append(str(path)) |
| #19 | return self.shell.run(pid, argv).stdout |
| #20 |