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§
Required Methods§
Sourcefn commit_if_staged(
&self,
worktree: &Path,
message: &str,
author: Author<'_>,
) -> Result<Option<String>, Self::Error>
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.
Sourcefn fetch(&self, repository: &Path, refspec: &str) -> Result<(), Self::Error>
fn fetch(&self, repository: &Path, refspec: &str) -> Result<(), Self::Error>
Update local references from origin as refspec maps them.
Sourcefn fetch_if_present(
&self,
repository: &Path,
refspec: &str,
) -> Result<(), Self::Error>
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.
Sourcefn push_with_lease(
&self,
worktree: &Path,
branch: &str,
expected: Option<&str>,
) -> Result<(), Self::Error>
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.
Sourcefn stage_update(
&self,
worktree: &Path,
paths: &[PathBuf],
) -> Result<(), Self::Error>
fn stage_update( &self, worktree: &Path, paths: &[PathBuf], ) -> Result<(), Self::Error>
Stage the changes at these worktree-relative paths, tracked or not.
Sourcefn worktree_add(
&self,
repository: &Path,
path: &Path,
baseline: &str,
) -> Result<(), Self::Error>
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.
Sourcefn worktree_remove(
&self,
repository: &Path,
path: &Path,
) -> Result<(), Self::Error>
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".