pub struct WorktreeRemove { /* private fields */ }Expand description
Remove a worktree: delete its directory and prune its entry.
Idempotent, so a retried step does not fail: an unknown worktree name
returns removed: false, and a worktree whose directory is already gone
only has its entry pruned. A locked worktree is not removed.
§Examples
use ironflow_ops_git::worktree::WorktreeRemove;
use ironflow_core::operation::Operation;
let op = WorktreeRemove::new("/path/to/repo", "wt-feature");
assert_eq!(op.kind(), "git");Implementations§
Source§impl WorktreeRemove
impl WorktreeRemove
Sourcepub fn new(repo_path: impl Into<PathBuf>, name: impl Into<String>) -> Self
pub fn new(repo_path: impl Into<PathBuf>, name: impl Into<String>) -> Self
Create a new worktree-remove operation.
Sourcepub async fn run(
&self,
_ctx: &OperationContext,
) -> Result<WorktreeRemoveOutput, OperationError>
pub async fn run( &self, _ctx: &OperationContext, ) -> Result<WorktreeRemoveOutput, OperationError>
Execute and return a typed result.
§Errors
Returns OperationError::External if the repository cannot be
opened, or the worktree is locked or cannot be deleted.
Trait Implementations§
Source§impl Operation for WorktreeRemove
impl Operation for WorktreeRemove
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the operation and return the result as JSON. Read more
Source§impl TypedOperation for WorktreeRemove
impl TypedOperation for WorktreeRemove
Source§type Output = WorktreeRemoveOutput
type Output = WorktreeRemoveOutput
The concrete output type that
Operation::execute produces.Auto Trait Implementations§
impl Freeze for WorktreeRemove
impl RefUnwindSafe for WorktreeRemove
impl Send for WorktreeRemove
impl Sync for WorktreeRemove
impl Unpin for WorktreeRemove
impl UnsafeUnpin for WorktreeRemove
impl UnwindSafe for WorktreeRemove
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