Skip to main content

MergeStatus

Enum MergeStatus 

Source
pub enum MergeStatus {
    Reachable,
    Content,
    Unmerged {
        unique: u64,
    },
    Unknown(String),
}
Expand description

Why stmb will (or won’t) delete a feature branch — the verdict behind the human-readable line stmb prints before acting. Computed purely from repo state.

Variants§

§

Reachable

The feature tip is an ancestor of base — a normal merge-commit or fast-forward merge. Safe to delete; git branch -d agrees.

§

Content

The tip is not reachable from base, but every commit on the branch has an equivalent patch already in base (squash- or rebase-merged). Safe to delete; git branch -d would wrongly refuse, so -D is used after this verdict.

§

Unmerged

unique commit(s) on the branch have no equivalent in base — genuine unmerged work. stmb refuses to delete it.

Fields

§unique: u64
§

Unknown(String)

stmb could not determine the answer (a git error / unparseable output). Fail-closed: treated like unmerged — refuse, never delete vacuously.

Implementations§

Source§

impl MergeStatus

Source

pub fn is_merged(&self) -> bool

True only when stmb has verified the branch is merged (safe to delete).

Source

pub fn reason(&self, feature: &str, base: &str) -> String

A readable “why” for the given branch/base — the reason half of the line stmb prints before it deletes (or declines to delete) the branch.

Trait Implementations§

Source§

impl Debug for MergeStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MergeStatus

Source§

impl PartialEq for MergeStatus

Source§

fn eq(&self, other: &MergeStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MergeStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.