Trait git_next_git::repository::open::OpenRepositoryLike

source ·
pub trait OpenRepositoryLike: Debug + Sync {
    // Required methods
    fn duplicate(&self) -> Box<dyn OpenRepositoryLike>;
    fn remote_branches(&self) -> Result<Vec<BranchName>>;
    fn find_default_remote(&self, direction: Direction) -> Option<RemoteUrl>;
    fn fetch(&self) -> Result<(), Error>;
    fn push(
        &self,
        repo_details: &RepoDetails,
        branch_name: &BranchName,
        to_commit: &GitRef,
        force: &Force,
    ) -> Result<()>;
    fn commit_log(
        &self,
        branch_name: &BranchName,
        find_commits: &[Commit],
    ) -> Result<Vec<Commit>>;
    fn read_file(
        &self,
        branch_name: &BranchName,
        file_name: &Path,
    ) -> Result<String>;
}

Required Methods§

source

fn duplicate(&self) -> Box<dyn OpenRepositoryLike>

source

fn remote_branches(&self) -> Result<Vec<BranchName>>

source

fn find_default_remote(&self, direction: Direction) -> Option<RemoteUrl>

source

fn fetch(&self) -> Result<(), Error>

source

fn push( &self, repo_details: &RepoDetails, branch_name: &BranchName, to_commit: &GitRef, force: &Force, ) -> Result<()>

source

fn commit_log( &self, branch_name: &BranchName, find_commits: &[Commit], ) -> Result<Vec<Commit>>

List of commits in a branch, optionally up-to any specified commit.

source

fn read_file( &self, branch_name: &BranchName, file_name: &Path, ) -> Result<String>

Read the contents of a file as a string.

Only handles files in the root of the repo.

Implementors§