Skip to main content

WorktreeRepoHandle

Struct WorktreeRepoHandle 

Source
pub struct WorktreeRepoHandle(/* private fields */);

Implementations§

Source§

impl WorktreeRepoHandle

Source

pub fn open(path: &Path) -> Result<Self, Error>

Source

pub fn as_repo(&self) -> &RepoHandle

Source

pub fn from_handle_unchecked(handle: RepoHandle) -> Self

Source

pub fn into_handle(self) -> RepoHandle

Source

pub fn default_branch(&self) -> Result<Branch<'_>, Error>

Source

pub fn cleanup_worktrees( &self, directory: &Path, deletion_notify_channel: &SyncSender<WorktreeName>, ) -> Result<Vec<CleanupWorktreeWarning>, CleanupWorktreeError>

Source

pub fn find_unmanaged_worktrees( &self, directory: &Path, ) -> Result<Vec<PathBuf>, Error>

Source

pub fn get_worktrees(&self) -> Result<Vec<Worktree>, Error>

Source

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

Source

pub fn add_worktree( &self, name: &WorktreeName, tracking_selection: TrackingSelection, ) -> Result<Vec<Warning>, Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.