pub struct WorktreeOperations { /* private fields */ }Expand description
Core worktree operations implementation
Implementations§
Source§impl WorktreeOperations
impl WorktreeOperations
Sourcepub fn new(repo_root: PathBuf, config: WorktreeConfig) -> Self
pub fn new(repo_root: PathBuf, config: WorktreeConfig) -> Self
Create new operations instance
Sourcepub fn new_with_repo_name(
repo_root: PathBuf,
config: WorktreeConfig,
repo_name: String,
) -> Self
pub fn new_with_repo_name( repo_root: PathBuf, config: WorktreeConfig, repo_name: String, ) -> Self
Create new operations instance with explicit repository name
Sourcepub async fn create_worktree(
&self,
options: CreateOptions,
) -> Result<WorktreeInfo>
pub async fn create_worktree( &self, options: CreateOptions, ) -> Result<WorktreeInfo>
Create a new git worktree
Sourcepub async fn remove_worktree(&self, options: RemoveOptions) -> Result<()>
pub async fn remove_worktree(&self, options: RemoveOptions) -> Result<()>
Remove a git worktree
Sourcepub async fn list_worktrees(&self) -> Result<Vec<WorktreeInfo>>
pub async fn list_worktrees(&self) -> Result<Vec<WorktreeInfo>>
List all git worktrees
Sourcepub async fn find_git_root(&self) -> Result<PathBuf>
pub async fn find_git_root(&self) -> Result<PathBuf>
Find git repository root
Sourcepub fn get_config(&self) -> &WorktreeConfig
pub fn get_config(&self) -> &WorktreeConfig
Get a reference to the config
Sourcepub async fn find_worktree_by_task_id(
&self,
task_id: &str,
) -> Result<Option<WorktreeInfo>>
pub async fn find_worktree_by_task_id( &self, task_id: &str, ) -> Result<Option<WorktreeInfo>>
Find worktree by task ID
Sourcepub async fn resolve_worktree_target(
&self,
target: &str,
) -> Result<WorktreeInfo>
pub async fn resolve_worktree_target( &self, target: &str, ) -> Result<WorktreeInfo>
Resolve target (task ID, branch name, or path) to worktree info
Trait Implementations§
Source§impl Clone for WorktreeOperations
impl Clone for WorktreeOperations
Source§fn clone(&self) -> WorktreeOperations
fn clone(&self) -> WorktreeOperations
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorktreeOperations
impl RefUnwindSafe for WorktreeOperations
impl Send for WorktreeOperations
impl Sync for WorktreeOperations
impl Unpin for WorktreeOperations
impl UnsafeUnpin for WorktreeOperations
impl UnwindSafe for WorktreeOperations
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