pub struct Git<'a> { /* private fields */ }Expand description
The ergonomic git accessor returned by Sandbox::git().
Implementations§
Source§impl<'a> Git<'a>
impl<'a> Git<'a>
pub fn new(runner: &'a dyn GitRunner) -> Self
Sourcepub async fn clone(
&self,
url: &str,
opts: GitCloneOptions,
) -> Result<(), SolariError>
pub async fn clone( &self, url: &str, opts: GitCloneOptions, ) -> Result<(), SolariError>
Clone url into opts.path under opts.cwd.
Sourcepub async fn status(&self, cwd: Option<&str>) -> Result<GitStatus, SolariError>
pub async fn status(&self, cwd: Option<&str>) -> Result<GitStatus, SolariError>
Parsed working-tree status.
Sourcepub async fn add(
&self,
paths: &[String],
cwd: Option<&str>,
) -> Result<(), SolariError>
pub async fn add( &self, paths: &[String], cwd: Option<&str>, ) -> Result<(), SolariError>
Stage paths (no-op on empty; uses -- to guard flag-like paths).
Sourcepub async fn commit(
&self,
message: &str,
opts: GitCommitOptions,
) -> Result<String, SolariError>
pub async fn commit( &self, message: &str, opts: GitCommitOptions, ) -> Result<String, SolariError>
Commit staged changes; returns the new commit hash.
Sourcepub async fn push(&self, opts: GitRemoteOptions) -> Result<(), SolariError>
pub async fn push(&self, opts: GitRemoteOptions) -> Result<(), SolariError>
Push to a remote (default origin).
Sourcepub async fn pull(&self, opts: GitRemoteOptions) -> Result<(), SolariError>
pub async fn pull(&self, opts: GitRemoteOptions) -> Result<(), SolariError>
Pull from a remote (default origin).
Sourcepub async fn checkout(
&self,
ref: &str,
cwd: Option<&str>,
create: bool,
) -> Result<(), SolariError>
pub async fn checkout( &self, ref: &str, cwd: Option<&str>, create: bool, ) -> Result<(), SolariError>
Check out an existing ref, or create a branch with create: true.
Sourcepub async fn branches(
&self,
cwd: Option<&str>,
) -> Result<Vec<GitBranch>, SolariError>
pub async fn branches( &self, cwd: Option<&str>, ) -> Result<Vec<GitBranch>, SolariError>
List local branches.
Sourcepub async fn log(
&self,
opts: GitLogOptions,
) -> Result<Vec<GitCommit>, SolariError>
pub async fn log( &self, opts: GitLogOptions, ) -> Result<Vec<GitCommit>, SolariError>
Recent commits, newest first.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Git<'a>
impl<'a> !UnwindSafe for Git<'a>
impl<'a> Freeze for Git<'a>
impl<'a> Send for Git<'a>
impl<'a> Sync for Git<'a>
impl<'a> Unpin for Git<'a>
impl<'a> UnsafeUnpin for Git<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more