26 lines
778 B
Python
Executable File
26 lines
778 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""Action ``commit`` (read-only): one of a conversation's commits as a DiffResult.
|
|
|
|
stdin ``{conversationId, sha, root?}`` (``root`` = the repo root a shim report
|
|
named) → ``DiffResult`` — from the ``commits`` plugin's ``diff`` export when it
|
|
is active (its cached patch), else the core's
|
|
``hub/diff/conversations/{cid}/commit?sha=&root=`` (lab git, the transcript's
|
|
patch or the worker it ran on)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pathlib
|
|
import sys
|
|
|
|
sys.dont_write_bytecode = True
|
|
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
|
import _lib # noqa: E402
|
|
|
|
|
|
def main(p: dict) -> dict:
|
|
return _lib.commit_diff(_lib.conversation_id(p), _lib.sha_of(p), _lib.root_of(p))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
_lib.run(main)
|