Skip to main content

classify_branch

Function classify_branch 

Source
pub fn classify_branch(root: &Path, local: &str, remote: &str) -> BranchClass
Expand description

Classify local branch relative to remote ref using SHA equality and directed ancestry.

local — a local branch name, e.g. “main” (resolved via refs/heads/<local>). remote — a remote ref name, e.g. “origin/main” (resolved as-is by git).

Every ancestry check includes a comment explaining which direction maps to which state because the mapping is not intuitive at a glance.