Skip to main content

RealGitClient

Struct RealGitClient 

Source
pub struct RealGitClient;
Expand description

Production GitClient implementation backed by real git commands.

Trait Implementations§

Source§

impl GitClient for RealGitClient

Source§

fn detect_git_info(&self, dir: PathBuf) -> GitFuture<Option<String>>

Detects the current branch name for the repository containing dir. Read more
Source§

fn find_git_repo_root(&self, dir: PathBuf) -> GitFuture<Option<PathBuf>>

Resolves the repository root directory that contains dir. Read more
Source§

fn create_worktree( &self, repo_path: PathBuf, worktree_path: PathBuf, branch_name: String, base_branch: String, ) -> GitFuture<Result<(), String>>

Creates a new worktree at worktree_path on branch_name from base_branch inside repo_path. Read more
Source§

fn remove_worktree( &self, worktree_path: PathBuf, ) -> GitFuture<Result<(), String>>

Removes the existing worktree at worktree_path. Read more
Source§

fn squash_merge_diff( &self, repo_path: PathBuf, source_branch: String, target_branch: String, ) -> GitFuture<Result<String, String>>

Returns the staged squash-merge preview diff from source_branch into target_branch within repo_path. Read more
Source§

fn squash_merge( &self, repo_path: PathBuf, source_branch: String, target_branch: String, commit_message: String, ) -> GitFuture<Result<SquashMergeOutcome, String>>

Performs a squash merge of source_branch into target_branch inside repo_path using commit_message. Read more
Source§

fn rebase( &self, repo_path: PathBuf, target_branch: String, ) -> GitFuture<Result<(), String>>

Runs git rebase <target_branch> in repo_path. Read more
Source§

fn rebase_start( &self, repo_path: PathBuf, target_branch: String, ) -> GitFuture<Result<RebaseStepResult, String>>

Starts a rebase onto target_branch and reports whether it completed immediately or stopped for conflicts. Read more
Source§

fn rebase_continue( &self, repo_path: PathBuf, ) -> GitFuture<Result<RebaseStepResult, String>>

Continues an in-progress rebase in repo_path. Read more
Source§

fn abort_rebase(&self, repo_path: PathBuf) -> GitFuture<Result<(), String>>

Aborts an in-progress rebase in repo_path. Read more
Source§

fn is_rebase_in_progress( &self, repo_path: PathBuf, ) -> GitFuture<Result<bool, String>>

Returns whether rebase metadata exists in repo_path. Read more
Source§

fn has_unmerged_paths( &self, repo_path: PathBuf, ) -> GitFuture<Result<bool, String>>

Returns whether unmerged index entries remain in repo_path. Read more
Source§

fn list_staged_conflict_marker_files( &self, repo_path: PathBuf, paths: Vec<String>, ) -> GitFuture<Result<Vec<String>, String>>

Filters paths to files that are staged and still contain conflict markers in repo_path. Read more
Source§

fn list_conflicted_files( &self, repo_path: PathBuf, ) -> GitFuture<Result<Vec<String>, String>>

Lists files currently marked conflicted in the index for repo_path. Read more
Source§

fn commit_all( &self, repo_path: PathBuf, message: String, no_verify: bool, ) -> GitFuture<Result<(), String>>

Stages and commits all changes in repo_path using message. Read more
Source§

fn commit_all_preserving_single_commit( &self, repo_path: PathBuf, base_branch: String, commit_message: String, message_strategy: SingleCommitMessageStrategy, no_verify: bool, ) -> GitFuture<Result<(), String>>

Commits all changes while preserving one evolving session commit in repo_path. Read more
Source§

fn stage_all(&self, repo_path: PathBuf) -> GitFuture<Result<(), String>>

Stages all tracked and untracked changes in repo_path. Read more
Source§

fn head_short_hash( &self, repo_path: PathBuf, ) -> GitFuture<Result<String, String>>

Returns the short HEAD hash for repo_path. Read more
Source§

fn head_commit_message( &self, repo_path: PathBuf, ) -> GitFuture<Result<Option<String>, String>>

Returns the full HEAD commit message for repo_path, or None when no commits exist. Read more
Source§

fn delete_branch( &self, repo_path: PathBuf, branch_name: String, ) -> GitFuture<Result<(), String>>

Deletes branch_name in repo_path. Read more
Source§

fn diff( &self, repo_path: PathBuf, base_branch: String, ) -> GitFuture<Result<String, String>>

Returns a patch diff from base_branch to current HEAD in repo_path. Read more
Source§

fn is_worktree_clean( &self, repo_path: PathBuf, ) -> GitFuture<Result<bool, String>>

Returns whether the worktree in repo_path has no local changes. Read more
Source§

fn has_commits_since( &self, repo_path: PathBuf, base_branch: String, ) -> GitFuture<Result<bool, String>>

Returns whether HEAD contains commits not reachable from base_branch. Read more
Source§

fn pull_rebase( &self, repo_path: PathBuf, ) -> GitFuture<Result<PullRebaseResult, String>>

Performs a pull --rebase in repo_path. Read more
Source§

fn push_current_branch( &self, repo_path: PathBuf, ) -> GitFuture<Result<String, String>>

Pushes the currently checked out branch for repo_path and returns the configured upstream reference after the successful push. Read more
Source§

fn push_current_branch_to_remote_branch( &self, repo_path: PathBuf, remote_branch_name: String, ) -> GitFuture<Result<String, String>>

Pushes the current branch for repo_path to one explicit remote branch name and returns the configured upstream reference after the push. Read more
Source§

fn current_upstream_reference( &self, repo_path: PathBuf, ) -> GitFuture<Result<String, String>>

Resolves the current upstream reference for repo_path. Read more
Source§

fn fetch_remote(&self, repo_path: PathBuf) -> GitFuture<Result<(), String>>

Fetches remote refs for repo_path. Read more
Source§

fn get_ahead_behind( &self, repo_path: PathBuf, ) -> GitFuture<Result<(u32, u32), String>>

Reads ahead/behind commit counts for repo_path. Read more
Source§

fn list_upstream_commit_titles( &self, repo_path: PathBuf, ) -> GitFuture<Result<Vec<String>, String>>

Returns commit subjects that exist in upstream but not in local HEAD. Read more
Source§

fn list_local_commit_titles( &self, repo_path: PathBuf, ) -> GitFuture<Result<Vec<String>, String>>

Returns commit subjects that exist in local HEAD but not in upstream. Read more
Source§

fn repo_url(&self, repo_path: PathBuf) -> GitFuture<Result<String, String>>

Reads the configured origin URL for repo_path. Read more
Source§

fn main_repo_root( &self, repo_path: PathBuf, ) -> GitFuture<Result<PathBuf, String>>

Resolves the main repository root for a repository or worktree path. Read more

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoMaybeUndefined<T> for T

Source§

impl<T> IntoOption<T> for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more