Enum git_repository::discover::repository::Path
source · [−]pub enum Path {
LinkedWorkTree {
work_dir: PathBuf,
git_dir: PathBuf,
},
WorkTree(PathBuf),
Repository(PathBuf),
}
Expand description
A repository path which either points to a work tree or the .git
repository itself.
Variants
LinkedWorkTree
Fields
work_dir: PathBuf
The base of the work tree.
git_dir: PathBuf
The worktree-private git dir, located within the main git directory which holds most of the information.
The currently checked out linked worktree along with its connected and existing git directory, or the worktree checkout of a submodule.
WorkTree(PathBuf)
The currently checked out or nascent work tree of a git repository
Repository(PathBuf)
The git repository itself, typically bare and without known worktree.
Note that it might still have linked work-trees which can be accessed later, weather bare or not, or it might be a
submodule git directory in the .git/modules/**/<name>
directory of the parent repository.
Implementations
sourceimpl Path
impl Path
sourcepub fn from_dot_git_dir(dir: impl Into<PathBuf>, kind: Kind) -> Path
pub fn from_dot_git_dir(dir: impl Into<PathBuf>, kind: Kind) -> Path
Instantiate a new path from dir
which is expected to be the .git
directory, with kind
indicating
whether it’s a bare repository or not.
sourcepub fn into_repository_and_work_tree_directories(
self
) -> (PathBuf, Option<PathBuf>)
pub fn into_repository_and_work_tree_directories(
self
) -> (PathBuf, Option<PathBuf>)
Consume and split this path into the location of the .git
directory as well as an optional path to the work tree.
Trait Implementations
sourceimpl Ord for Path
impl Ord for Path
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Path> for Path
impl PartialOrd<Path> for Path
sourcefn partial_cmp(&self, other: &Path) -> Option<Ordering>
fn partial_cmp(&self, other: &Path) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for Path
impl StructuralEq for Path
impl StructuralPartialEq for Path
Auto Trait Implementations
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more