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

Function resolve_path_commit_for

scripts/update_cddl.py:193–200  ·  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

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

Callers 1

pin_vendorsFunction · 0.85

Calls 1

getFunction · 0.70

Tested by

no test coverage detected