pub struct Worktree { /* private fields */ }Expand description
A checkout of one commit, removed when it goes out of scope.
Implementations§
Source§impl Worktree
impl Worktree
Sourcepub fn of(
repo: &Path,
revspec: &str,
beneath: &Path,
as_: &str,
) -> Result<Self, Trouble>
pub fn of( repo: &Path, revspec: &str, beneath: &Path, as_: &str, ) -> Result<Self, Trouble>
Resolves a revspec and lays that commit out under beneath, in a
directory called as_.
The name is the caller’s and not the commit’s, because the two sides of a comparison are allowed to be the same commit — asking what a store already holds is a diff of one revision against itself — and two worktrees of one commit under one name is a refusal from git. Detached for the same reason: a branch checked out twice is another one.
pub fn path(&self) -> &Path
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