Check if commit1 is able to fast-forward to commit2. Return True if it is able to fast-forward.
(config: EvoGitConfig, commit1: str, commit2: str)
| 671 | |
| 672 | |
| 673 | def fast_forwardness(config: EvoGitConfig, commit1: str, commit2: str) -> bool: |
| 674 | """Check if commit1 is able to fast-forward to commit2. Return True if it is able to fast-forward.""" |
| 675 | code = subprocess.run( |
| 676 | ["git", "merge-base", "--is-ancestor", commit1, commit2], |
| 677 | cwd=config.git_dir, |
| 678 | stdout=subprocess.DEVNULL, |
| 679 | stderr=subprocess.DEVNULL, |
| 680 | ).returncode |
| 681 | return code == 0 |
| 682 | |
| 683 | |
| 684 | def pairwise_distances(config: EvoGitConfig, commits: list[str]) -> list[list[int]]: |
nothing calls this directly
no outgoing calls
no test coverage detected