pub enum RewriteSource<'index, ContentChange, SubmoduleStatus> {
RewriteFromIndex {
index_entries: &'index [Entry],
source_entry: &'index Entry,
source_entry_index: usize,
source_rela_path: &'index BStr,
source_status: EntryStatus<ContentChange, SubmoduleStatus>,
},
CopyFromDirectoryEntry {
source_dirwalk_entry: Entry,
source_dirwalk_entry_collapsed_directory_status: Option<Status>,
source_dirwalk_entry_id: ObjectId,
},
}
worktree-rewrites
only.Expand description
Either an index entry for renames or another directory entry in case of copies.
Variants§
RewriteFromIndex
The source originates in the index and is detected as missing in the working tree. This can also happen for copies.
Fields
source_entry: &'index Entry
The entry that is the source of the rewrite, which means it was removed on disk, equivalent to Change::Removed.
Note that the entry-id is the content-id of the source of the rewrite.
source_entry_index: usize
The index of the source_entry
for lookup in index_entries
- useful to look at neighbors.
source_status: EntryStatus<ContentChange, SubmoduleStatus>
The computed status of the source_entry
.
CopyFromDirectoryEntry
This source originates in the directory tree and is always the source of copies.
Fields
source_dirwalk_entry: Entry
The source of the copy operation, which is also an entry of the directory walk.
Note that its rela_path
is the source of the rewrite.
source_dirwalk_entry_collapsed_directory_status: Option<Status>
collapsed_directory_status
is Some(dir_status)
if this source_dirwalk_entry
was part of a directory with the given
dir_status
that wasn’t the same as the one of source_dirwalk_entry
and if gix_dir::walk::Options::emit_collapsed was
CollapsedEntriesEmissionMode::OnStatusMismatch.
It will also be Some(dir_status)
if that option was CollapsedEntriesEmissionMode::All.
Implementations§
Trait Implementations§
Source§impl<'index, ContentChange: Clone, SubmoduleStatus: Clone> Clone for RewriteSource<'index, ContentChange, SubmoduleStatus>
impl<'index, ContentChange: Clone, SubmoduleStatus: Clone> Clone for RewriteSource<'index, ContentChange, SubmoduleStatus>
Source§fn clone(&self) -> RewriteSource<'index, ContentChange, SubmoduleStatus>
fn clone(&self) -> RewriteSource<'index, ContentChange, SubmoduleStatus>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'index, ContentChange: Debug, SubmoduleStatus: Debug> Debug for RewriteSource<'index, ContentChange, SubmoduleStatus>
impl<'index, ContentChange: Debug, SubmoduleStatus: Debug> Debug for RewriteSource<'index, ContentChange, SubmoduleStatus>
Source§impl<'index, ContentChange: PartialEq, SubmoduleStatus: PartialEq> PartialEq for RewriteSource<'index, ContentChange, SubmoduleStatus>
impl<'index, ContentChange: PartialEq, SubmoduleStatus: PartialEq> PartialEq for RewriteSource<'index, ContentChange, SubmoduleStatus>
Source§fn eq(
&self,
other: &RewriteSource<'index, ContentChange, SubmoduleStatus>,
) -> bool
fn eq( &self, other: &RewriteSource<'index, ContentChange, SubmoduleStatus>, ) -> bool
self
and other
values to be equal, and is used by ==
.