pub enum Entry<'index, ContentChange, SubmoduleStatus> {
Modification {
entries: &'index [Entry],
entry: &'index Entry,
entry_index: usize,
rela_path: &'index BStr,
status: EntryStatus<ContentChange, SubmoduleStatus>,
},
DirectoryContents {
entry: Entry,
collapsed_directory_status: Option<Status>,
},
Rewrite {
source: RewriteSource<'index, ContentChange, SubmoduleStatus>,
dirwalk_entry: Entry,
dirwalk_entry_collapsed_directory_status: Option<Status>,
dirwalk_entry_id: ObjectId,
diff: Option<DiffLineStats>,
copy: bool,
},
}
worktree-rewrites
only.Expand description
An ‘entry’ in the sense of a merge of modified tracked files and results from a directory walk.
Variants§
Modification
A tracked file was modified, and index-specific information is passed.
Fields
status: EntryStatus<ContentChange, SubmoduleStatus>
The computed status of the entry.
DirectoryContents
An entry returned by the directory walk, without any relation to the index.
This can happen if ignored files are returned as well, or if rename-tracking is disabled.
Fields
collapsed_directory_status: Option<Status>
collapsed_directory_status
is Some(dir_status)
if this entry
was part of a directory with the given
dir_status
that wasn’t the same as the one of 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.
Rewrite
The rewrite tracking discovered a match between a deleted and added file, and considers them equal enough, depending on the tracker settings.
Note that the source of the rewrite is always the index as it detects the absence of entries, something that can’t be done during a directory walk.
Fields
source: RewriteSource<'index, ContentChange, SubmoduleStatus>
The source of the rewrite operation.
dirwalk_entry: Entry
The untracked entry found during the disk traversal, the destination of the rewrite.
Note that its rela_path
is the destination of the rewrite, and the current
location of the entry.
dirwalk_entry_collapsed_directory_status: Option<Status>
collapsed_directory_status
is Some(dir_status)
if this dirwalk_entry
was part of a directory with the given
dir_status
that wasn’t the same as the one of 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.
dirwalk_entry_id: ObjectId
The object id after the rename, specifically hashed in order to determine equality.
diff: Option<DiffLineStats>
It’s None
if the ‘source.id’ is equal to dirwalk_entry_id
, as identity made an actual diff computation unnecessary.
Otherwise, and if enabled, it’s Some(stats)
to indicate how similar both entries were.
Implementations§
Source§impl<ContentChange, SubmoduleStatus> Entry<'_, ContentChange, SubmoduleStatus>
impl<ContentChange, SubmoduleStatus> Entry<'_, ContentChange, SubmoduleStatus>
Access
Sourcepub fn summary(&self) -> Option<Summary>
pub fn summary(&self) -> Option<Summary>
Return a summary of the entry as digest of its status, or None
if this entry is
created from the directory walk and is not untracked, or if it is merely to communicate
a needed update to the index entry.
Sourcepub fn source_rela_path(&self) -> &BStr
pub fn source_rela_path(&self) -> &BStr
The repository-relative path at which the source of a rewrite is located.
If this isn’t a rewrite, the path is the location of the entry itself.
Sourcepub fn destination_rela_path(&self) -> &BStr
pub fn destination_rela_path(&self) -> &BStr
The repository-relative path at which the destination of a rewrite is located.
If this isn’t a rewrite, the path is the location of the entry itself.