Skip to main content

GitAt

Struct GitAt 

Source
pub struct GitAt<'a, R: ProcessRunner = JobRunner> { /* private fields */ }
Expand description

A Git client with a working directory bound, so calls drop the leading dir argument — git.at(dir).status() is git.status(dir). Construct one with Git::at (or, through the facade, vcs_core::Repo::git_at). Cheap to copy: it only borrows the client and the path.

Implementations§

Source§

impl<'a, R: ProcessRunner> GitAt<'a, R>

Source

pub async fn run(&self, args: &[String]) -> Result<String>

Bound form of Git’s run.

Source

pub async fn run_raw(&self, args: &[String]) -> Result<ProcessResult<String>>

Bound form of Git’s run_raw.

Source

pub async fn run_args(&self, args: &[&str]) -> Result<String>

Bound form of Git’s run_args.

Source

pub async fn run_raw_args(&self, args: &[&str]) -> Result<ProcessResult<String>>

Bound form of Git’s run_raw_args.

Source

pub async fn version(&self) -> Result<String>

Bound form of Git’s version.

Source

pub async fn status(&self) -> Result<Vec<StatusEntry>>

Bound form of Git’s status (with dir pre-bound).

Source

pub async fn status_text(&self) -> Result<String>

Bound form of Git’s status_text (with dir pre-bound).

Source

pub async fn current_branch(&self) -> Result<String>

Bound form of Git’s current_branch (with dir pre-bound).

Source

pub async fn branches(&self) -> Result<Vec<Branch>>

Bound form of Git’s branches (with dir pre-bound).

Source

pub async fn log(&self, max: usize) -> Result<Vec<Commit>>

Bound form of Git’s log (with dir pre-bound).

Source

pub async fn log_range(&self, range: &str, max: usize) -> Result<Vec<Commit>>

Bound form of Git’s log_range (with dir pre-bound).

Source

pub async fn rev_parse(&self, rev: &str) -> Result<String>

Bound form of Git’s rev_parse (with dir pre-bound).

Source

pub async fn rev_parse_short(&self, rev: &str) -> Result<String>

Bound form of Git’s rev_parse_short (with dir pre-bound).

Source

pub async fn init(&self) -> Result<()>

Bound form of Git’s init (with dir pre-bound).

Source

pub async fn add(&self, paths: &[PathBuf]) -> Result<()>

Bound form of Git’s add (with dir pre-bound).

Source

pub async fn commit(&self, message: &str) -> Result<()>

Bound form of Git’s commit (with dir pre-bound).

Source

pub async fn create_branch(&self, name: &str) -> Result<()>

Bound form of Git’s create_branch (with dir pre-bound).

Source

pub async fn checkout(&self, reference: &str) -> Result<()>

Bound form of Git’s checkout (with dir pre-bound).

Source

pub async fn checkout_detach(&self, commit: &str) -> Result<()>

Bound form of Git’s checkout_detach (with dir pre-bound).

Source

pub async fn commit_paths( &self, paths: &[PathBuf], message: &str, amend: bool, ) -> Result<()>

Bound form of Git’s commit_paths (with dir pre-bound).

Source

pub async fn last_commit_message(&self) -> Result<String>

Bound form of Git’s last_commit_message (with dir pre-bound).

Source

pub async fn is_unborn(&self) -> Result<bool>

Bound form of Git’s is_unborn (with dir pre-bound).

Source

pub async fn diff_is_empty(&self) -> Result<bool>

Bound form of Git’s diff_is_empty (with dir pre-bound).

Source

pub async fn common_dir(&self) -> Result<PathBuf>

Bound form of Git’s common_dir (with dir pre-bound).

Source

pub async fn git_dir(&self) -> Result<PathBuf>

Bound form of Git’s git_dir (with dir pre-bound).

Source

pub async fn resolve_commit(&self, rev: &str) -> Result<String>

Bound form of Git’s resolve_commit (with dir pre-bound).

Source

pub async fn remote_head_branch(&self) -> Result<Option<String>>

Bound form of Git’s remote_head_branch (with dir pre-bound).

Source

pub async fn branch_exists(&self, name: &str) -> Result<bool>

Bound form of Git’s branch_exists (with dir pre-bound).

Source

pub async fn remote_branch_exists(&self, name: &str) -> Result<bool>

Bound form of Git’s remote_branch_exists (with dir pre-bound).

Source

pub async fn remote_url(&self, remote: &str) -> Result<String>

Bound form of Git’s remote_url (with dir pre-bound).

Source

pub async fn upstream(&self) -> Result<Option<String>>

Bound form of Git’s upstream (with dir pre-bound).

Source

pub async fn remote_branches(&self, remote: &str) -> Result<Vec<String>>

Bound form of Git’s remote_branches (with dir pre-bound).

Source

pub async fn is_merged(&self, branch: &str, target: &str) -> Result<bool>

Bound form of Git’s is_merged (with dir pre-bound).

Source

pub async fn set_upstream(&self, branch: &str, upstream: &str) -> Result<()>

Bound form of Git’s set_upstream (with dir pre-bound).

Source

pub async fn delete_branch(&self, name: &str, force: bool) -> Result<()>

Bound form of Git’s delete_branch (with dir pre-bound).

Source

pub async fn rename_branch(&self, old: &str, new: &str) -> Result<()>

Bound form of Git’s rename_branch (with dir pre-bound).

Source

pub async fn rev_list_count(&self, range: &str) -> Result<usize>

Bound form of Git’s rev_list_count (with dir pre-bound).

Source

pub async fn diff_range_is_empty(&self, range: &str) -> Result<bool>

Bound form of Git’s diff_range_is_empty (with dir pre-bound).

Source

pub async fn diff_stat(&self, range: &str) -> Result<DiffStat>

Bound form of Git’s diff_stat (with dir pre-bound).

Source

pub async fn diff_text(&self, spec: DiffSpec) -> Result<String>

Bound form of Git’s diff_text (with dir pre-bound).

Source

pub async fn diff(&self, spec: DiffSpec) -> Result<Vec<FileDiff>>

Bound form of Git’s diff (with dir pre-bound).

Source

pub async fn staged_is_empty(&self) -> Result<bool>

Bound form of Git’s staged_is_empty (with dir pre-bound).

Source

pub async fn is_rebase_in_progress(&self) -> Result<bool>

Bound form of Git’s is_rebase_in_progress (with dir pre-bound).

Source

pub async fn is_merge_in_progress(&self) -> Result<bool>

Bound form of Git’s is_merge_in_progress (with dir pre-bound).

Source

pub async fn fetch(&self) -> Result<()>

Bound form of Git’s fetch (with dir pre-bound).

Source

pub async fn fetch_remote_branch(&self, branch: &str) -> Result<()>

Bound form of Git’s fetch_remote_branch (with dir pre-bound).

Source

pub async fn push(&self, spec: GitPush) -> Result<()>

Bound form of Git’s push (with dir pre-bound).

Source

pub async fn merge_squash(&self, branch: &str) -> Result<()>

Bound form of Git’s merge_squash (with dir pre-bound).

Source

pub async fn merge_commit( &self, branch: &str, no_ff: bool, message: Option<String>, ) -> Result<()>

Bound form of Git’s merge_commit (with dir pre-bound).

Source

pub async fn merge_no_commit( &self, branch: &str, squash: bool, no_ff: bool, ) -> Result<()>

Bound form of Git’s merge_no_commit (with dir pre-bound).

Source

pub async fn merge_abort(&self) -> Result<()>

Bound form of Git’s merge_abort (with dir pre-bound).

Source

pub async fn merge_continue(&self) -> Result<()>

Bound form of Git’s merge_continue (with dir pre-bound).

Source

pub async fn reset_merge(&self) -> Result<()>

Bound form of Git’s reset_merge (with dir pre-bound).

Source

pub async fn reset_hard(&self, rev: &str) -> Result<()>

Bound form of Git’s reset_hard (with dir pre-bound).

Source

pub async fn rebase(&self, onto: &str) -> Result<()>

Bound form of Git’s rebase (with dir pre-bound).

Source

pub async fn rebase_abort(&self) -> Result<()>

Bound form of Git’s rebase_abort (with dir pre-bound).

Source

pub async fn rebase_continue(&self) -> Result<()>

Bound form of Git’s rebase_continue (with dir pre-bound).

Source

pub async fn stash_push(&self, include_untracked: bool) -> Result<()>

Bound form of Git’s stash_push (with dir pre-bound).

Source

pub async fn stash_pop(&self) -> Result<()>

Bound form of Git’s stash_pop (with dir pre-bound).

Source

pub async fn worktree_list(&self) -> Result<Vec<Worktree>>

Bound form of Git’s worktree_list (with dir pre-bound).

Source

pub async fn worktree_add(&self, spec: WorktreeAdd) -> Result<()>

Bound form of Git’s worktree_add (with dir pre-bound).

Source

pub async fn worktree_remove(&self, path: &Path, force: bool) -> Result<()>

Bound form of Git’s worktree_remove (with dir pre-bound).

Source

pub async fn worktree_move(&self, from: &Path, to: &Path) -> Result<()>

Bound form of Git’s worktree_move (with dir pre-bound).

Source

pub async fn worktree_prune(&self) -> Result<()>

Bound form of Git’s worktree_prune (with dir pre-bound).

Trait Implementations§

Source§

impl<R: ProcessRunner> Clone for GitAt<'_, R>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: ProcessRunner> Copy for GitAt<'_, R>

Auto Trait Implementations§

§

impl<'a, R> Freeze for GitAt<'a, R>

§

impl<'a, R> RefUnwindSafe for GitAt<'a, R>
where R: RefUnwindSafe,

§

impl<'a, R> Send for GitAt<'a, R>

§

impl<'a, R> Sync for GitAt<'a, R>

§

impl<'a, R> Unpin for GitAt<'a, R>

§

impl<'a, R> UnsafeUnpin for GitAt<'a, R>

§

impl<'a, R> UnwindSafe for GitAt<'a, R>
where R: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.