Skip to main content

ProposalGit

Trait ProposalGit 

Source
pub trait ProposalGit {
    type Error: StdError + Send + Sync + 'static;

    // Required methods
    fn commit_if_staged(
        &self,
        worktree: &Path,
        message: &str,
        author: Author<'_>,
    ) -> Result<Option<String>, Self::Error>;
    fn fetch(&self, repository: &Path, refspec: &str) -> Result<(), Self::Error>;
    fn fetch_if_present(
        &self,
        repository: &Path,
        refspec: &str,
    ) -> Result<(), Self::Error>;
    fn push_with_lease(
        &self,
        worktree: &Path,
        branch: &str,
        expected: Option<&str>,
    ) -> Result<(), Self::Error>;
    fn stage_update(
        &self,
        worktree: &Path,
        paths: &[PathBuf],
    ) -> Result<(), Self::Error>;
    fn worktree_add(
        &self,
        repository: &Path,
        path: &Path,
        baseline: &str,
    ) -> Result<(), Self::Error>;
    fn worktree_remove(
        &self,
        repository: &Path,
        path: &Path,
    ) -> Result<(), Self::Error>;
}
Expand description

Repository changes that maintain a release proposal branch.

Required Associated Types§

Source

type Error: StdError + Send + Sync + 'static

The failure of a branch update.

Required Methods§

Source

fn commit_if_staged( &self, worktree: &Path, message: &str, author: Author<'_>, ) -> Result<Option<String>, Self::Error>

Commit staged changes, returning the new commit hash, or None when nothing was staged.

Source

fn fetch(&self, repository: &Path, refspec: &str) -> Result<(), Self::Error>

Update local references from origin as refspec maps them.

Source

fn fetch_if_present( &self, repository: &Path, refspec: &str, ) -> Result<(), Self::Error>

Like fetch, but succeed when the remote has no reference named by refspec.

Source

fn push_with_lease( &self, worktree: &Path, branch: &str, expected: Option<&str>, ) -> Result<(), Self::Error>

Push the worktree’s HEAD to branch, failing if the remote branch has moved away from expected.

Source

fn stage_update( &self, worktree: &Path, paths: &[PathBuf], ) -> Result<(), Self::Error>

Stage the changes at these worktree-relative paths, tracked or not.

Source

fn worktree_add( &self, repository: &Path, path: &Path, baseline: &str, ) -> Result<(), Self::Error>

Create a disposable worktree at the not yet existing path, checked out to baseline on a private branch.

Source

fn worktree_remove( &self, repository: &Path, path: &Path, ) -> Result<(), Self::Error>

Remove a worktree created with ProposalGit::worktree_add.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§