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, start_ref: String, ) -> GitFuture<Result<(), GitError>>

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

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

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, GitError>>

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, GitError>>

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<(), GitError>>

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

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

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

fn rebase_onto_start( &self, repo_path: PathBuf, new_base: String, old_base: String, ) -> GitFuture<Result<RebaseStepResult, GitError>>

Starts git rebase --onto new_base old_base in repo_path. Read more
Source§

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

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

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

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

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

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

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

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>, GitError>>

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>, GitError>>

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<(), GitError>>

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<(), GitError>>

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

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

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

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

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

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

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

fn ref_hash( &self, repo_path: PathBuf, reference: String, ) -> GitFuture<Result<String, GitError>>

Returns the full commit hash for a branch, tag, or commit-ish ref. Read more
Source§

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

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<(), GitError>>

Deletes branch_name in repo_path. Read more
Source§

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

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, GitError>>

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

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

Returns raw porcelain status for the worktree in repo_path. Read more
Source§

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

Returns raw porcelain status for tracked files in repo_path. Read more
Source§

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

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

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

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

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

Pushes the currently checked out branch for repo_path with --force-with-lease 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, GitError>>

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

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

Checks whether remote_branch_name already exists on the remote for the repository at repo_path. Read more
Source§

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

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

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

Fetches remote refs for repo_path. Read more
Source§

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

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

fn get_ref_ahead_behind( &self, repo_path: PathBuf, left_ref: String, right_ref: String, ) -> GitFuture<Result<(u32, u32), GitError>>

Reads ahead/behind commit counts between two explicit refs. Read more
Source§

fn branch_tracking_statuses( &self, repo_path: PathBuf, ) -> GitFuture<Result<BranchTrackingMap, GitError>>

Reads ahead/behind snapshots for all local branches that track an upstream. Read more
Source§

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

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>, GitError>>

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, GitError>>

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

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

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, 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, 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.