diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /vendor/gix-fs/src/lib.rs | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-fs/src/lib.rs')
-rw-r--r-- | vendor/gix-fs/src/lib.rs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/vendor/gix-fs/src/lib.rs b/vendor/gix-fs/src/lib.rs new file mode 100644 index 000000000..aa576c240 --- /dev/null +++ b/vendor/gix-fs/src/lib.rs @@ -0,0 +1,55 @@ +//! A crate with file-system specific utilities. +#![deny(rust_2018_idioms, missing_docs)] +#![forbid(unsafe_code)] + +/// Common knowledge about the worktree that is needed across most interactions with the work tree +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] +#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)] +pub struct Capabilities { + /// If true, the filesystem will store paths as decomposed unicode, i.e. `รค` becomes `"a\u{308}"`, which means that + /// we have to turn these forms back from decomposed to precomposed unicode before storing it in the index or generally + /// using it. This also applies to input received from the command-line, so callers may have to be aware of this and + /// perform conversions accordingly. + /// If false, no conversions will be performed. + pub precompose_unicode: bool, + /// If true, the filesystem ignores the case of input, which makes `A` the same file as `a`. + /// This is also called case-folding. + pub ignore_case: 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. + pub executable_bit: 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. + pub symlink: bool, +} +mod capabilities; + +mod snapshot; + +use std::path::PathBuf; + +pub use snapshot::{FileSnapshot, SharedFileSnapshot, SharedFileSnapshotMut}; + +/// +pub mod symlink; + +/// +pub mod dir; + +/// A stack of path components with the delegation of side-effects as the currently set path changes, component by component. +#[derive(Clone)] +pub struct Stack { + /// The prefix/root for all paths we handle. + root: PathBuf, + /// the most recent known cached that we know is valid. + current: PathBuf, + /// The relative portion of `valid` that was added previously. + current_relative: PathBuf, + /// The amount of path components of 'current' beyond the roots components. + valid_components: usize, + /// If set, we assume the `current` element is a directory to affect calls to `(push|pop)_directory()`. + current_is_directory: bool, +} + +/// +pub mod stack; |