(base, head, cwd=None)
| 48 | |
| 49 | |
| 50 | def 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 | |
| 61 | def has_local_dependencies(go_mod, package): |
no test coverage detected