pub struct Outcome<'a> {
pub tree: Editor<'a>,
pub conflicts: Vec<Conflict>,
pub failed_on_first_unresolved_conflict: bool,
}Expand description
The outcome produced by tree().
Fields§
§tree: Editor<'a>The ready-made (but unwritten) base tree, including all non-conflicting changes, and the changes that had conflicts which could be resolved automatically.
This means, if all of their changes were conflicting, this will be equivalent to the base tree.
conflicts: Vec<Conflict>The set of conflicts we encountered. Can be empty to indicate there was no conflict.
Note that conflicts might have been auto-resolved, but they are listed here for completeness.
Use has_unresolved_conflicts() to see if any action is needed
before using tree.
failed_on_first_unresolved_conflict: booltrue if conflicts contains only a single unresolved conflict in the last slot, but
possibly more resolved ones before that.
This also makes this outcome a very partial merge that cannot be completed.
Only set if fail_on_conflict is true.
Implementations§
Source§impl Outcome<'_>
impl Outcome<'_>
Sourcepub fn has_unresolved_conflicts(&self, how: TreatAsUnresolved) -> bool
pub fn has_unresolved_conflicts(&self, how: TreatAsUnresolved) -> bool
Return true if there is any conflict that would still need to be resolved as they would yield undesirable trees.
This is based on how to determine what should be considered unresolved.
Sourcepub fn index_changed_after_applying_conflicts(
&self,
index: &mut State,
how: TreatAsUnresolved,
removal_mode: RemovalMode,
) -> bool
pub fn index_changed_after_applying_conflicts( &self, index: &mut State, how: TreatAsUnresolved, removal_mode: RemovalMode, ) -> bool
Returns true if index changed as we applied conflicting stages to it, using how to determine if a
conflict should be considered unresolved.
removal_mode decides how unconflicted entries should be removed if they are superseded by
their conflicted counterparts.
It’s important that index is at the state of Self::tree.
Note that in practice, whenever there is a single conflict, this function will return true.