(file_a: Path, file_b: Path)
| 22 | |
| 23 | |
| 24 | def git_diff(file_a: Path, file_b: Path) -> int: |
| 25 | if which('git') is None: |
| 26 | raise RuntimeError('git not found.') |
| 27 | |
| 28 | return subprocess.run([ |
| 29 | 'git', |
| 30 | 'diff', |
| 31 | '--color', |
| 32 | '--word-diff=plain', |
| 33 | '--word-diff-regex=.', |
| 34 | '--ignore-space-change', |
| 35 | '--ignore-blank-lines', |
| 36 | '--exit-code', |
| 37 | file_a, |
| 38 | file_b, |
| 39 | ], encoding='utf8', check=False).returncode |