pub struct Worktree { /* private fields */ }Expand description
A detached checkout of one commit, removed when dropped.
Implementations§
Source§impl Worktree
impl Worktree
Sourcepub fn add(path: &Path, sha: &str, hooks: &Path) -> Result<Worktree>
pub fn add(path: &Path, sha: &str, hooks: &Path) -> Result<Worktree>
Check sha out at path, which must not exist yet.
hooks is an empty directory used as core.hooksPath: worktree add
runs the repository’s post-checkout hook, and a project hook that
installs dependencies or regenerates files would run at every commit
of the backfill, unasked, and change what the build starts from.
pub fn path(&self) -> &Path
Sourcepub fn check_contains(&self, p: &Path) -> Result<()>
pub fn check_contains(&self, p: &Path) -> Result<()>
Check that p, symlinks resolved, is inside this checkout.
Refusing .. in the configured path is not enough: an old commit can
hold a symlink where the current tak.toml expects a directory, and one
pointing at the live tree would build or measure that tree at every
commit of the backfill.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Worktree
impl Freeze for Worktree
impl Move for Worktree
impl RefUnwindSafe for Worktree
impl Send for Worktreewhere
RawVecInner: Send,
impl Sync for Worktreewhere
RawVecInner: Sync,
impl Unpin for Worktree
impl UnsafeUnpin for Worktree
impl UnwindSafe for Worktreewhere
RawVecInner: UnwindSafe,
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