pub struct WorktreeManager { /* private fields */ }Expand description
Manages git worktrees for workspace isolation.
Implementations§
Source§impl WorktreeManager
impl WorktreeManager
Sourcepub fn new(repo_root: &Path) -> Self
pub fn new(repo_root: &Path) -> Self
Create a new worktree manager for the given repository root.
Sourcepub fn create(&self, prefix: &str) -> Result<WorktreeInfo, String>
pub fn create(&self, prefix: &str) -> Result<WorktreeInfo, String>
Create a new worktree with an auto-generated branch name.
Returns the worktree path and branch name.
Sourcepub fn create_at(
&self,
path: &Path,
branch: &str,
) -> Result<WorktreeInfo, String>
pub fn create_at( &self, path: &Path, branch: &str, ) -> Result<WorktreeInfo, String>
Create a worktree at a specific path with a specific branch.
Sourcepub fn list(&self) -> Vec<WorktreeInfo>
pub fn list(&self) -> Vec<WorktreeInfo>
List all worktrees.
Sourcepub fn cleanup_all(&self) -> Vec<String>
pub fn cleanup_all(&self) -> Vec<String>
Clean up all opendev-created worktrees.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorktreeManager
impl RefUnwindSafe for WorktreeManager
impl Send for WorktreeManager
impl Sync for WorktreeManager
impl Unpin for WorktreeManager
impl UnsafeUnpin 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