pub struct WorktreeRepoHandle(/* private fields */);Implementations§
Source§impl WorktreeRepoHandle
impl WorktreeRepoHandle
pub fn open(path: &Path) -> Result<Self, Error>
pub fn as_repo(&self) -> &RepoHandle
pub fn from_handle_unchecked(handle: RepoHandle) -> Self
pub fn into_handle(self) -> RepoHandle
pub fn default_branch(&self) -> Result<Branch<'_>, Error>
pub fn cleanup_worktrees( &self, directory: &Path, deletion_notify_channel: &SyncSender<WorktreeName>, ) -> Result<Vec<CleanupWorktreeWarning>, CleanupWorktreeError>
pub fn find_unmanaged_worktrees( &self, directory: &Path, ) -> Result<Vec<PathBuf>, Error>
pub fn get_worktrees(&self) -> Result<Vec<Worktree>, Error>
Sourcepub fn remove_worktree(
&self,
base_dir: &Path,
worktree_name: &WorktreeName,
worktree_dir: &Path,
force: bool,
worktree_config: Option<&WorktreeRootConfig>,
default_branch: &Branch<'_>,
) -> Result<(), WorktreeRemoveError>
pub fn remove_worktree( &self, base_dir: &Path, worktree_name: &WorktreeName, worktree_dir: &Path, force: bool, worktree_config: Option<&WorktreeRootConfig>, default_branch: &Branch<'_>, ) -> Result<(), WorktreeRemoveError>
We remove the worktree only under the following conditions (unless force is given):
- It has no changes
- If it has a remote tracking branch, it does not differ
- It is merged into the default branch
- It is merged into any “persistent branch”
To clarify: Even if it is merged into local persistent branches, it will still not be deleted when the remote branch differs
pub fn add_worktree( &self, name: &WorktreeName, tracking_selection: TrackingSelection, ) -> Result<Vec<Warning>, Error>
Auto Trait Implementations§
impl Freeze for WorktreeRepoHandle
impl RefUnwindSafe for WorktreeRepoHandle
impl Send for WorktreeRepoHandle
impl !Sync for WorktreeRepoHandle
impl Unpin for WorktreeRepoHandle
impl UnsafeUnpin for WorktreeRepoHandle
impl UnwindSafe for WorktreeRepoHandle
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