pub struct StatMatchPolicy {
pub trust_ctime: bool,
pub check_stat: bool,
pub use_nanosec: bool,
}Expand description
Git match_stat_data policy (core.trustctime, core.checkstat, core.usenanosec).
Fields§
§trust_ctime: boolWhen true, compare ctime fields when check_stat is enabled.
check_stat: boolWhen true, compare owner, inode, device, and nanoseconds (if use_nanosec).
use_nanosec: boolWhen true with check_stat, compare sub-second mtime/ctime fractions, and judge an
entry racily clean only when its mtime is at or after the index file’s to the
nanosecond rather than to the second.
Defaults to Self::DEFAULT_USE_NANOSEC.
Implementations§
Source§impl StatMatchPolicy
impl StatMatchPolicy
Sourcepub const DEFAULT_USE_NANOSEC: bool = false
pub const DEFAULT_USE_NANOSEC: bool = false
core.usenanosec when the key is unset: on for Windows, off elsewhere.
A clone or switch writes the whole tree and then its index within the same second. Under whole-second racy detection every entry is then re-read once by the next status, and opening files is what makes that slow on Windows. NTFS keeps 100 ns timestamps, so comparing sub-second fractions there is sound and keeps that first status stat-only, as it is with Git for Windows. Elsewhere Git’s default is off.
Sourcepub fn from_config(config: Option<&ConfigSet>) -> Self
pub fn from_config(config: Option<&ConfigSet>) -> Self
Load policy from repository config, using the platform defaults for unset keys.
Trait Implementations§
Source§impl Clone for StatMatchPolicy
impl Clone for StatMatchPolicy
impl Copy for StatMatchPolicy
Source§impl Debug for StatMatchPolicy
impl Debug for StatMatchPolicy
Source§impl Default for StatMatchPolicy
impl Default for StatMatchPolicy
impl Eq for StatMatchPolicy
Source§impl PartialEq for StatMatchPolicy
impl PartialEq for StatMatchPolicy
impl StructuralPartialEq for StatMatchPolicy
Auto Trait Implementations§
impl Freeze for StatMatchPolicy
impl RefUnwindSafe for StatMatchPolicy
impl Send for StatMatchPolicy
impl Sync for StatMatchPolicy
impl Unpin for StatMatchPolicy
impl UnsafeUnpin for StatMatchPolicy
impl UnwindSafe for StatMatchPolicy
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.