Skip to main content

DirectoryRenameMode

Enum DirectoryRenameMode 

Source
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

Source

pub const CONFIG_KEY: &'static str = "merge.directoryRenames"

Config key holding the mode.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DirectoryRenameMode

Source§

impl Debug for DirectoryRenameMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DirectoryRenameMode

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for DirectoryRenameMode

Source§

impl Hash for DirectoryRenameMode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DirectoryRenameMode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DirectoryRenameMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Sequence for T
where T: Eq + Hash,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.