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§
Sourcefn open_repo(&self, path: &Path) -> Result<Box<dyn GitRepo>, GitError>
fn open_repo(&self, path: &Path) -> Result<Box<dyn GitRepo>, GitError>
Open an existing repository at path.
Sourcefn clone_repo(
&self,
url: &str,
path: &Path,
branch: Option<&str>,
) -> Result<Box<dyn GitRepo>, GitError>
fn clone_repo( &self, url: &str, path: &Path, branch: Option<&str>, ) -> Result<Box<dyn GitRepo>, GitError>
Clone a remote repository into path.
Sourcefn is_git_repo(&self, path: &Path) -> bool
fn is_git_repo(&self, path: &Path) -> bool
Quick check: is path the root of a git repository?