MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / pr_paths

Function pr_paths

scripts/ci-scope.py:50–58  ·  view source on GitHub ↗
(base, head, cwd=None)

Source from the content-addressed store, hash-verified

48
49
50def pr_paths(base, head, cwd=None):
51 for sha in (base, head):
52 if not isinstance(sha, str) or not re.fullmatch(r'[0-9a-fA-F]{40}', sha):
53 raise ValueError('PR base and head must be exact commit SHAs')
54 git('cat-file', '-e', sha + '^{commit}', cwd=cwd)
55 ancestor = git('merge-base', base, head, cwd=cwd).decode('ascii').strip()
56 if not re.fullmatch(r'[0-9a-fA-F]{40}', ancestor):
57 raise ValueError('missing or malformed merge base')
58 return decode_paths(git('diff', '--name-only', '-z', '--no-renames', ancestor, head, cwd=cwd))
59
60
61def has_local_dependencies(go_mod, package):

Callers 1

for_eventFunction · 0.85

Calls 2

gitFunction · 0.85
decode_pathsFunction · 0.85

Tested by

no test coverage detected