pub struct WorkTree { /* private fields */ }Expand description
One git work tree, with the set of paths its index tracks.
Implementations§
Source§impl WorkTree
impl WorkTree
Sourcepub fn open(root: &Path) -> Result<Self, GitError>
pub fn open(root: &Path) -> Result<Self, GitError>
Reads the index of the work tree rooted at root.
§Errors
If git cannot be run at all, or refuses to list the index.
Sourcepub fn holds_tracked_path(&self, dir: &Path) -> bool
pub fn holds_tracked_path(&self, dir: &Path) -> bool
Whether anything tracked lives at or below dir.
Answers true for a path this work tree cannot express, because every caller is asking
in order to decide whether deleting dir is safe, and “I could not tell” has to read as
“do not touch it”.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkTree
impl RefUnwindSafe for WorkTree
impl Send for WorkTree
impl Sync for WorkTree
impl Unpin for WorkTree
impl UnsafeUnpin for WorkTree
impl UnwindSafe for WorkTree
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
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more