pub enum Change {
Addition {
location: BString,
relation: Option<Relation>,
entry_mode: EntryMode,
id: ObjectId,
},
Deletion {
location: BString,
relation: Option<Relation>,
entry_mode: EntryMode,
id: ObjectId,
},
Modification {
location: BString,
previous_entry_mode: EntryMode,
previous_id: ObjectId,
entry_mode: EntryMode,
id: ObjectId,
},
Rewrite {
source_location: BString,
source_entry_mode: EntryMode,
source_relation: Option<Relation>,
source_id: ObjectId,
diff: Option<DiffLineStats>,
entry_mode: EntryMode,
id: ObjectId,
location: BString,
relation: Option<Relation>,
copy: bool,
},
}
blob
only.Expand description
Represents any possible change in order to turn one tree into another, with fully-owned data.
Variants§
Addition
An entry was added, like the addition of a file or directory.
Fields
location: BString
The location of the file or directory.
It may be empty if file names is None
.
Deletion
An entry was deleted, like the deletion of a file or directory.
Fields
location: BString
The location of the file or directory.
It may be empty if file names is None
.
Modification
An entry was modified, e.g. changing the contents of a file adjusts its object id and turning a file into a symbolic link adjusts its mode.
Fields
location: BString
The location of the file or directory.
It may be empty if file names is None
.
Rewrite
Entries are considered rewritten if they are not trees and they, according to some understanding of identity, were renamed
or copied.
In case of renames, this means they originally appeared as Deletion
signalling their source as well as an
Addition
acting as destination.
In case of copies, the copy
flag is true and typically represents a perfect copy of a source was made.
This variant can only be encountered if rewrite tracking is enabled.
Note that mode changes may have occurred as well, i.e. changes from executable to non-executable or vice-versa.
Fields
source_location: BString
The location of the source of the rename operation.
It may be empty if file names is None
.
source_relation: Option<Relation>
Identifies a relationship between the source and another source, making it easy to reconstruct the top-level of directory changes.
source_id: ObjectId
The object id of the entry before the rename.
Note that this is the same as id
if we require the similarity to be 100%, but may
be different otherwise.
diff: Option<DiffLineStats>
Information about the diff we performed to detect similarity and match the source_id
with the current state at id
.
It’s None
if source_id
is equal to id
, as identity made an actual diff computation unnecessary.
entry_mode: EntryMode
The mode of the entry after the rename. It could differ but still be considered a rename as we are concerned only about content.
location: BString
The location after the rename or copy operation.
It may be empty if file names is None
.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
Blanket Implementations§
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)