Skip to main content

is_commit_merged

Function is_commit_merged 

Source
pub fn is_commit_merged(root: &Path, commit_sha: &str) -> bool
Expand description

Checks whether a commit’s work is on the default branch when any of:

  • git merge-base --is-ancestor <commit> <default> succeeds;
  • every commit git cherry <default> <commit> lists is marked -;
  • merging it would change nothing: git merge-tree --write-tree <default> <commit> exits 0 and the tree id it prints equals git rev-parse <default>^{tree}.