MCPcopy Index your code
hub / github.com/openai/plugins / resolve_git_commit

Function resolve_git_commit

plugins/codex-security/scripts/workbench_db.py:784–797  ·  view source on GitHub ↗
(target: Path, revision: str, label: str)

Source from the content-addressed store, hash-verified

782
783
784def resolve_git_commit(target: Path, revision: str, label: str) -> str:
785 value = optional_text(revision, maximum=512)
786 if not value:
787 raise SystemExit(f"{label} is required.")
788 resolved = git_output(
789 target,
790 "rev-parse",
791 "--verify",
792 "--end-of-options",
793 f"{value}^{{commit}}",
794 )
795 if resolved is None:
796 raise SystemExit(f"{label} does not resolve to a local Git commit: {value}")
797 return resolved
798
799
800def require_diff_target(

Callers 1

require_diff_targetFunction · 0.85

Calls 2

optional_textFunction · 0.90
git_outputFunction · 0.90

Tested by

no test coverage detected