Struct gix_fs::Capabilities
source · pub struct Capabilities {
pub precompose_unicode: bool,
pub ignore_case: bool,
pub executable_bit: bool,
pub symlink: bool,
}
Expand description
Common knowledge about the worktree that is needed across most interactions with the work tree
Fields§
§precompose_unicode: bool
If true
, the filesystem will consider the precomposed umlaut ä
similar to its decomposed form "a\u{308}"
and consider them the same.
If false
, the filesystem will only see bytes which means that the above example could live side-by-side.
Even though a filesystem that treats both forms the same will still reproduce the exact same byte sequence during traversal for instance,
this might also mean that we see paths in their decomposed form (this happens when creating directory ä
in MacOS Finder for example).
If Git would store such decomposed paths in the repository, which only sees bytes, on linux this might mean the path will look strange at best, which is why it prefers to store precomposed unicode on systems where it matters, like MacOS and Windows.
For best compatibility, and with this value being true
, we will turn decomposed paths and input like command-line arguments into their
precomposed forms, so no decomposed byte sequences should end up in storage.
ignore_case: bool
If true, the filesystem ignores the case of input, which makes A
the same file as a
.
This is also called case-folding.
executable_bit: bool
If true, we assume the executable bit is honored as part of the files mode. If false, we assume the file system ignores the executable bit, hence it will be reported as ‘off’ even though we just tried to set it to be on.
symlink: bool
If true, the file system supports symbolic links and we should try to create them. Otherwise symbolic links will be checked out as files which contain the link as text.
Implementations§
source§impl Capabilities
impl Capabilities
sourcepub fn probe(git_dir: &Path) -> Self
pub fn probe(git_dir: &Path) -> Self
try to determine all values in this context by probing them in the given git_dir
, which
should be on the file system the git repository is located on.
git_dir
is a typical git repository, expected to be populated with the typical files like config
.
All errors are ignored and interpreted on top of the default for the platform the binary is compiled for.
Trait Implementations§
source§impl Clone for Capabilities
impl Clone for Capabilities
source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Capabilities
impl Debug for Capabilities
source§impl Default for Capabilities
impl Default for Capabilities
source§impl Hash for Capabilities
impl Hash for Capabilities
source§impl Ord for Capabilities
impl Ord for Capabilities
source§fn cmp(&self, other: &Capabilities) -> Ordering
fn cmp(&self, other: &Capabilities) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for Capabilities
impl PartialEq for Capabilities
source§fn eq(&self, other: &Capabilities) -> bool
fn eq(&self, other: &Capabilities) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Capabilities
impl PartialOrd for Capabilities
source§fn partial_cmp(&self, other: &Capabilities) -> Option<Ordering>
fn partial_cmp(&self, other: &Capabilities) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more