MCPcopy Create free account
hub / github.com/BillHuang2001/evogit / fast_forwardness

Function fast_forwardness

python-impl/evogit/utils/git.py:673–681  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

671
672
673def 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
684def pairwise_distances(config: EvoGitConfig, commits: list[str]) -> list[list[int]]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected