MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / resolve_path_commit_for

Function resolve_path_commit_for

scripts/update_cddl.py:194–201  ·  view source on GitHub ↗

(branch, commit) for the first branch with the path: the last commit there to change anything under it.

(repo, branches, path)

Source from the content-addressed store, hash-verified

192
193
194def resolve_path_commit_for(repo, branches, path):
195 """(branch, commit) for the first branch with the path: the last commit there to change anything under it."""
196 for branch in branches:
197 data = get(f"https://api.github.com/repos/{repo}/commits?sha={branch}&path={path}&per_page=1", API_HEADERS)
198 commits = json.loads(data)
199 if commits:
200 return branch, commits[0]["sha"]
201 raise RuntimeError(f"No commit on {repo} ({', '.join(branches)}) touches {path}")
202
203
204def sha256_of(data):

Callers 1

pin_vendorsFunction · 0.85

Calls 1

getFunction · 0.70

Tested by

no test coverage detected