pub struct ConflictReport {
pub entries: Vec<ConflictEntry>,
}Expand description
Structured capture of merge conflicts from an in-memory merge_trees.
Returned from CandidateComposer::merge_trees whenever the produced
git2::Index carries conflict stages. This is the structured
replacement for the string-only "Merge conflicts detected" error raised
by the legacy in-place RepositoryHandle::merge.
Fields§
§entries: Vec<ConflictEntry>One entry per (conflicted path, present side).
Implementations§
Source§impl ConflictReport
impl ConflictReport
Sourcepub fn from_index(index: &Index) -> Git2DBResult<Self>
pub fn from_index(index: &Index) -> Git2DBResult<Self>
Build a report by walking the conflict stages of an index.
Pure read: does not mutate the index. Returns an empty report when the index has no conflicts.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of distinct conflicted paths.
This is the meaningful “conflict count”: a modify/modify conflict on
one file is one conflict, even though it contributes two stage entries
(Ours and Theirs). For the raw per-side entry count, use
entry_count.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Raw number of (path, side) entries captured — one per present stage,
so a single conflicted path typically counts as 2–3.
Sourcepub fn iter(&self) -> Iter<'_, ConflictEntry>
pub fn iter(&self) -> Iter<'_, ConflictEntry>
Iterate over the captured entries.
Sourcepub fn paths(&self) -> Vec<&str>
pub fn paths(&self) -> Vec<&str>
Distinct conflicted paths’ display strings, in first-seen order.
Dedup is by raw ConflictEntry::path_bytes, not the lossy
path string: two distinct non-UTF-8 git paths that happen to share
a lossy display string are counted separately (a String-keyed dedup
would undercount them). The returned display strings may therefore
contain visually-duplicate values; use
path_keys for exact byte identity.
Trait Implementations§
Source§impl Clone for ConflictReport
impl Clone for ConflictReport
Source§fn clone(&self) -> ConflictReport
fn clone(&self) -> ConflictReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConflictReport
impl Debug for ConflictReport
Source§impl Default for ConflictReport
impl Default for ConflictReport
Source§fn default() -> ConflictReport
fn default() -> ConflictReport
Source§impl Display for ConflictReport
impl Display for ConflictReport
Source§impl Error for ConflictReport
impl Error for ConflictReport
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<ConflictReport> for Git2DBError
impl From<ConflictReport> for Git2DBError
Source§fn from(source: ConflictReport) -> Self
fn from(source: ConflictReport) -> Self
Auto Trait Implementations§
impl Freeze for ConflictReport
impl RefUnwindSafe for ConflictReport
impl Send for ConflictReport
impl Sync for ConflictReport
impl Unpin for ConflictReport
impl UnsafeUnpin for ConflictReport
impl UnwindSafe for ConflictReport
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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