Skip to main content

GitPort

Trait GitPort 

Source
pub trait GitPort {
    // Required methods
    fn is_git_repo(&self, path: &Path) -> Result<bool, GitError>;
    fn get_github_remote(&self, path: &Path) -> Result<Option<String>, GitError>;
    fn create_worktree(
        &self,
        repo_path: &Path,
        worktree_path: &Path,
        branch: &str,
        create_branch: bool,
    ) -> Result<(), GitError>;
    fn remove_worktree(
        &self,
        repo_path: &Path,
        worktree_path: &Path,
    ) -> Result<(), GitError>;
    fn current_branch(&self, path: &Path) -> Result<String, GitError>;
    fn get_pr_branch(&self, pr_url: &str) -> Result<String, GitError>;
}

Required Methods§

Source

fn is_git_repo(&self, path: &Path) -> Result<bool, GitError>

Source

fn get_github_remote(&self, path: &Path) -> Result<Option<String>, GitError>

Source

fn create_worktree( &self, repo_path: &Path, worktree_path: &Path, branch: &str, create_branch: bool, ) -> Result<(), GitError>

Source

fn remove_worktree( &self, repo_path: &Path, worktree_path: &Path, ) -> Result<(), GitError>

Source

fn current_branch(&self, path: &Path) -> Result<String, GitError>

Source

fn get_pr_branch(&self, pr_url: &str) -> Result<String, GitError>

Implementors§