pub enum DirectoryRenameMode {
Off,
Apply,
Conflict,
}Expand description
How a three-way merge treats files one side adds inside a directory the other side renamed.
A directory counts as renamed when one side moved all of its files out of it and most of
them (the destination with the most files, without a tie) into one other directory. Files the
other side added to the old directory, or renamed into it, then most likely belong in the new
one. Read from the merge.directoryRenames config with Self::from_config.
Variants§
Off
Leave such files where the adding side put them (merge.directoryRenames=false).
Apply
Move them into the renamed directory as a clean merge (true).
Conflict
Move them, but leave each one unmerged at the adding side’s stage so the user confirms
the new location (conflict; Git’s default).
Implementations§
Source§impl DirectoryRenameMode
impl DirectoryRenameMode
Sourcepub const CONFIG_KEY: &'static str = "merge.directoryRenames"
pub const CONFIG_KEY: &'static str = "merge.directoryRenames"
Config key holding the mode.
Sourcepub fn from_config_value(value: &str) -> Result<Self, ConfigError>
pub fn from_config_value(value: &str) -> Result<Self, ConfigError>
Parse a merge.directoryRenames value: conflict or a Git boolean (true applies the
renames, false turns them off).
§Errors
ConfigError::InvalidDirectoryRenames for any other value.
Sourcepub fn from_config(config: &ConfigSet) -> Result<Self, ConfigError>
pub fn from_config(config: &ConfigSet) -> Result<Self, ConfigError>
The mode set by Self::CONFIG_KEY in config, or Self::Conflict when unset.
§Errors
ConfigError::InvalidDirectoryRenames when the value is not recognised.
Sourcepub fn from_repo(repo: &Repository) -> Result<Self>
pub fn from_repo(repo: &Repository) -> Result<Self>
Self::from_config for the configuration of repo.
§Errors
Config load failures, and ConfigError::InvalidDirectoryRenames.
Trait Implementations§
Source§impl Clone for DirectoryRenameMode
impl Clone for DirectoryRenameMode
impl Copy for DirectoryRenameMode
Source§impl Debug for DirectoryRenameMode
impl Debug for DirectoryRenameMode
Source§impl Default for DirectoryRenameMode
impl Default for DirectoryRenameMode
impl Eq for DirectoryRenameMode
Source§impl Hash for DirectoryRenameMode
impl Hash for DirectoryRenameMode
Source§impl PartialEq for DirectoryRenameMode
impl PartialEq for DirectoryRenameMode
impl StructuralPartialEq for DirectoryRenameMode
Auto Trait Implementations§
impl Freeze for DirectoryRenameMode
impl RefUnwindSafe for DirectoryRenameMode
impl Send for DirectoryRenameMode
impl Sync for DirectoryRenameMode
impl Unpin for DirectoryRenameMode
impl UnsafeUnpin for DirectoryRenameMode
impl UnwindSafe for DirectoryRenameMode
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.