MCPcopy Create free account
hub / github.com/BillHuang2001/evogit / get_commit_by_branch

Function get_commit_by_branch

python-impl/evogit/utils/git.py:173–186  ·  view source on GitHub ↗
(
    config: EvoGitConfig, branch: str, worktree: Optional[str] = None
)

Source from the content-addressed store, hash-verified

171
172
173def get_commit_by_branch(
174 config: EvoGitConfig, branch: str, worktree: Optional[str] = None
175) -> str:
176 cwd = worktree if worktree is not None else config.git_dir
177 return (
178 subprocess.run(
179 ["git", "rev-parse", branch],
180 cwd=cwd,
181 check=True,
182 capture_output=True,
183 )
184 .stdout.decode("utf-8")
185 .strip()
186 )
187
188
189def get_commit_by_tag(

Callers 2

get_commit_by_tagFunction · 0.85
read_head_commitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected