Skip to main content

ConflictState

Struct ConflictState 

Source
pub struct ConflictState {
    pub operation_label: String,
    pub original_branch_oid: String,
    pub new_tip_oid: String,
    pub conflicting_commit_oid: String,
    pub remaining_oids: Vec<String>,
    pub conflicting_files: Vec<String>,
    pub still_unresolved: bool,
    pub moved_commit_oid: Option<String>,
    pub squash_context: Option<SquashContext>,
}
Expand description

Enough state to resume or abort a conflicted rebase.

When a cherry-pick produces conflicts during a rebase, the partially merged index is written to the working tree. The user resolves the conflicts, then calls rebase_continue (which reads the resolved index and creates the commit) or rebase_abort (which restores the branch to original_branch_oid).

Fields§

§operation_label: String

Human-readable label for the operation that triggered this conflict (e.g. “Drop”, “Squash”). Used in dialog titles and messages.

§original_branch_oid: String

The branch tip OID before the operation started, used to restore on abort.

§new_tip_oid: String

The new tip OID built so far (all commits cherry-picked before the conflicting one).

§conflicting_commit_oid: String

The OID of the commit whose cherry-pick conflicted.

§remaining_oids: Vec<String>

OIDs of commits that still need to be cherry-picked after the conflicting commit is resolved, in order (oldest first).

§conflicting_files: Vec<String>

Paths of files that have conflict markers in the index (stage > 0). Collected at the point of conflict so the dialog can list them.

§still_unresolved: bool

True when rebase_continue was called but the index still had unresolved entries. The dialog uses this to show a warning to the user.

§moved_commit_oid: Option<String>

When this conflict was triggered by a move operation, this holds the OID of the commit being moved. The conflict view uses it to tell the user whether the moved commit itself conflicted or a successor did.

§squash_context: Option<SquashContext>

When present, the conflict arose during the initial squash tree creation (source vs target overlap). After the user resolves the conflict the TUI should open the editor and then call squash_finalize instead of rebase_continue.

Implementations§

Source§

impl ConflictState

Source

pub fn is_squash_tree_conflict(&self) -> bool

Whether this conflict arose from a squash-time tree conflict (as opposed to a descendant rebase conflict).

Trait Implementations§

Source§

impl Clone for ConflictState

Source§

fn clone(&self) -> ConflictState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConflictState

Source§

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

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

impl PartialEq for ConflictState

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Eq for ConflictState

Source§

impl StructuralPartialEq for ConflictState

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.