pub enum BranchClass {
Equal,
Behind,
Ahead,
Diverged,
RemoteOnly,
NoRemote,
}Expand description
Classification of a local branch relative to its origin counterpart.
Direction note: merge-base --is-ancestor A B returns 0 iff A is reachable from B.
- local == remote → Equal
- local ancestor-of remote (not equal) → Behind (FF possible: remote has new commits)
- remote ancestor-of local (not equal) → Ahead (local has unpushed commits)
- neither is an ancestor of the other → Diverged (manual resolution required)
- local ref absent, remote ref present → RemoteOnly (safe to create local ref)
- remote ref cannot be resolved → NoRemote (local-only or no origin)
Variants§
Equal
Behind
Ahead
Diverged
RemoteOnly
Local ref does not exist; origin ref does. Safe to create the local ref.
NoRemote
Remote ref cannot be resolved. Branch is local-only or origin is unreachable.
Auto Trait Implementations§
impl Freeze for BranchClass
impl RefUnwindSafe for BranchClass
impl Send for BranchClass
impl Sync for BranchClass
impl Unpin for BranchClass
impl UnsafeUnpin for BranchClass
impl UnwindSafe for BranchClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more