pub enum Conflict {
BothDeleted,
AddedByUs,
DeletedByThem,
AddedByThem,
DeletedByUs,
BothAdded,
BothModified,
}
Expand description
Describes a conflicting entry as comparison between ‘our’ version and ‘their’ version of it.
If one side isn’t specified, it is assumed to have modified the entry. In general, there would be no conflict if both parties ended up in the same state.
Variants§
BothDeleted
Both deleted a different version of the entry.
AddedByUs
We added, they modified, ending up in different states.
DeletedByThem
They deleted the entry, we modified it.
AddedByThem
They added the entry, we modified it, ending up in different states.
DeletedByUs
We deleted the entry, they modified it, ending up in different states.
BothAdded
Both added the entry in different states.
BothModified
Both modified the entry, ending up in different states.
Implementations§
Source§impl Conflict
impl Conflict
Sourcepub fn try_from_entry(
entries: &[Entry],
path_backing: &PathStorageRef,
start_index: usize,
entry_path: &BStr,
) -> Option<(Self, usize)>
pub fn try_from_entry( entries: &[Entry], path_backing: &PathStorageRef, start_index: usize, entry_path: &BStr, ) -> Option<(Self, usize)>
Given entries
and path_backing
, both values obtained from an index, use start_index
and enumerate
all conflict stages that still match entry_path
to produce a conflict description.
Also return the amount of extra-entries that were part of the conflict declaration (not counting the entry at start_index
)
If for some reason entry at start_index
isn’t in conflicting state, None
is returned.