Skip to main content

GitBackend

Trait GitBackend 

Source
pub trait GitBackend: Send + Sync {
    // Required methods
    fn open_repo(&self, path: &Path) -> Result<Box<dyn GitRepo>, GitError>;
    fn clone_repo(
        &self,
        url: &str,
        path: &Path,
        branch: Option<&str>,
    ) -> Result<Box<dyn GitRepo>, GitError>;
    fn is_git_repo(&self, path: &Path) -> bool;
}
Expand description

Factory for opening / cloning repositories.

Required Methods§

Source

fn open_repo(&self, path: &Path) -> Result<Box<dyn GitRepo>, GitError>

Open an existing repository at path.

Source

fn clone_repo( &self, url: &str, path: &Path, branch: Option<&str>, ) -> Result<Box<dyn GitRepo>, GitError>

Clone a remote repository into path.

Source

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

Quick check: is path the root of a git repository?

Implementors§