pub struct GitModule { /* private fields */ }Expand description
Git module instance, tied to a Session.
Tracks which worktrees were created by this session via
owned_worktrees. Write operations check ownership before
proceeding; read operations bypass the check entirely.
Implementations§
Source§impl GitModule
impl GitModule
pub fn new(session: Arc<Session>) -> Self
pub fn status(&self) -> Result<String>
pub fn log(&self, max_count: usize) -> Result<String>
pub fn diff(&self) -> Result<String>
pub fn register_worktree(&mut self, path: PathBuf)
pub fn is_owned(&self, path: &PathBuf) -> bool
pub fn ensure_owned(&self, path: &PathBuf) -> Result<()>
pub fn worktree_list(&self) -> Result<String>
pub fn worktree_add( &mut self, name: &str, branch: &str, base_branch: Option<&str>, ) -> Result<String>
pub fn worktree_remove(&mut self, name: &str) -> Result<String>
pub fn commit( &self, working_dir: &Path, message: &str, paths: Option<&[String]>, ) -> Result<String>
pub fn merge( &self, branch: &str, into_branch: &str, working_dir: &Path, ) -> Result<String>
pub fn branch_delete(&self, branch: &str) -> Result<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitModule
impl RefUnwindSafe for GitModule
impl Send for GitModule
impl Sync for GitModule
impl Unpin for GitModule
impl UnsafeUnpin for GitModule
impl UnwindSafe for GitModule
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