pub struct WorktreeManager { /* private fields */ }Expand description
Manager for git worktrees used by agents
Implementations§
Source§impl WorktreeManager
impl WorktreeManager
Sourcepub fn new(base_repo: PathBuf) -> SubagentResult<Self>
pub fn new(base_repo: PathBuf) -> SubagentResult<Self>
Create a new worktree manager
Sourcepub async fn create_worktree(
&self,
agent_name: &str,
base_branch: Option<&str>,
) -> SubagentResult<AgentWorktree>
pub async fn create_worktree( &self, agent_name: &str, base_branch: Option<&str>, ) -> SubagentResult<AgentWorktree>
Create a new worktree for an agent
Sourcepub async fn remove_worktree(&self, id: Uuid) -> SubagentResult<()>
pub async fn remove_worktree(&self, id: Uuid) -> SubagentResult<()>
Remove a worktree
Sourcepub async fn commit_changes(
&self,
worktree_id: Uuid,
message: &str,
) -> SubagentResult<String>
pub async fn commit_changes( &self, worktree_id: Uuid, message: &str, ) -> SubagentResult<String>
Commit changes in a worktree
Sourcepub async fn merge_agent_changes(
&self,
worktree_ids: Vec<Uuid>,
target_branch: &str,
strategy: ConflictStrategy,
) -> SubagentResult<MergeResult>
pub async fn merge_agent_changes( &self, worktree_ids: Vec<Uuid>, target_branch: &str, strategy: ConflictStrategy, ) -> SubagentResult<MergeResult>
Merge changes from multiple agents
Sourcepub async fn cleanup_old_worktrees(
&self,
max_age: Duration,
) -> SubagentResult<()>
pub async fn cleanup_old_worktrees( &self, max_age: Duration, ) -> SubagentResult<()>
Clean up old worktrees
Sourcepub async fn list_worktrees(&self) -> Vec<AgentWorktree>
pub async fn list_worktrees(&self) -> Vec<AgentWorktree>
List all active worktrees
Sourcepub async fn get_worktree(&self, id: Uuid) -> Option<AgentWorktree>
pub async fn get_worktree(&self, id: Uuid) -> Option<AgentWorktree>
Get worktree by ID
Sourcepub async fn deactivate_worktree(&self, id: Uuid) -> SubagentResult<()>
pub async fn deactivate_worktree(&self, id: Uuid) -> SubagentResult<()>
Mark a worktree as inactive
Auto Trait Implementations§
impl Freeze for WorktreeManager
impl !RefUnwindSafe for WorktreeManager
impl Send for WorktreeManager
impl Sync for WorktreeManager
impl Unpin for WorktreeManager
impl !UnwindSafe for WorktreeManager
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more