pub struct GitBackend { /* private fields */ }Expand description
Git backend.
Uses gix::ThreadSafeRepository so the struct is natively Send + Sync
without any mutex. Each method obtains a cheap thread-local repository view
via gix::ThreadSafeRepository::to_thread_local, eliminating serialization
under concurrent async load.
Implementations§
Trait Implementations§
Source§impl VcsBackend for GitBackend
impl VcsBackend for GitBackend
fn status_digest(&self) -> Result<StatusDigest>
fn local_branches(&self) -> Result<Vec<BranchInfo>>
fn remote_branches(&self) -> Result<Vec<BranchInfo>>
fn list_commits(&self) -> Result<Vec<CommitInfo>>
fn list_commits_sorted(&self, order: SortOrder) -> Result<Vec<CommitInfo>>
fn log_since( &self, since: SystemTime, until: SystemTime, ) -> Result<Vec<CommitInfo>>
fn find_commit(&self, id: &CommitId) -> Result<CommitInfo>
Source§fn query_commits(&self, query: CommitQuery) -> Result<CommitQueryResult>
fn query_commits(&self, query: CommitQuery) -> Result<CommitQueryResult>
Returns a bounded page of commit history according to
query. Read moreSource§fn create_annotated_tag(&self, name: &str, message: &str) -> Result<()>
fn create_annotated_tag(&self, name: &str, message: &str) -> Result<()>
Creates an annotated tag at HEAD. Read more
fn diff(&self, from: &CommitId, to: &CommitId) -> Result<DiffSummary>
Source§fn remote_url(&self, name: &str) -> Result<Option<String>>
fn remote_url(&self, name: &str) -> Result<Option<String>>
Returns the fetch URL of the named remote, or
Ok(None) if not configured. Read moreSource§fn is_dirty(&self) -> Result<bool>
fn is_dirty(&self) -> Result<bool>
Returns
true if the working tree has any uncommitted changes
(staged or unstaged). Bare repositories always return false.Source§fn merge_base(&self, a: &CommitId, b: &CommitId) -> Result<Option<CommitId>>
fn merge_base(&self, a: &CommitId, b: &CommitId) -> Result<Option<CommitId>>
Returns the best common ancestor of
a and b, or None if there
is no shared history (unrelated histories).Source§fn is_ancestor(
&self,
candidate: &CommitId,
descendant: &CommitId,
) -> Result<bool>
fn is_ancestor( &self, candidate: &CommitId, descendant: &CommitId, ) -> Result<bool>
Returns
true if candidate is a direct or transitive ancestor of
descendant. A commit is considered its own ancestor.Source§fn ahead_behind(
&self,
local: &CommitId,
upstream: &CommitId,
) -> Result<AheadBehind>
fn ahead_behind( &self, local: &CommitId, upstream: &CommitId, ) -> Result<AheadBehind>
Source§fn branch_ahead_behind(&self, branch: &str) -> Result<Option<AheadBehind>>
fn branch_ahead_behind(&self, branch: &str) -> Result<Option<AheadBehind>>
Returns ahead/behind counts for the configured upstream of
branch. Read moreSource§fn repository_info(&self) -> Result<RepositoryInfo>
fn repository_info(&self) -> Result<RepositoryInfo>
Returns a lightweight metadata snapshot of the repository. Read more
Source§fn branch_tracking(&self, branch: &str) -> Result<BranchTrackingInfo>
fn branch_tracking(&self, branch: &str) -> Result<BranchTrackingInfo>
Returns tracking metadata and divergence data for
branch. Read moreSource§fn local_branch_tracking(&self) -> Result<Vec<BranchTrackingInfo>>
fn local_branch_tracking(&self) -> Result<Vec<BranchTrackingInfo>>
Returns tracking metadata for all local branches, sorted ascending
by full ref name. Read more
Source§fn blame(&self, path: &Path) -> Result<Vec<BlameEntry>>
fn blame(&self, path: &Path) -> Result<Vec<BlameEntry>>
Returns per-line commit attribution for
path at HEAD. Read moreSource§fn worktree_status(&self) -> Result<WorktreeStatus>
fn worktree_status(&self) -> Result<WorktreeStatus>
Returns per-file working-tree status: staged changes, unstaged
changes, and untracked files (with gitignore applied).
Source§fn rich_worktree_status(
&self,
options: StatusOptions,
) -> Result<RichWorktreeStatus>
fn rich_worktree_status( &self, options: StatusOptions, ) -> Result<RichWorktreeStatus>
Returns a richer working-tree status with more file-level change kinds. Read more
Source§fn file_at_commit(&self, path: &Path, commit_id: &CommitId) -> Result<Vec<u8>>
fn file_at_commit(&self, path: &Path, commit_id: &CommitId) -> Result<Vec<u8>>
Returns the raw bytes of
path (relative to the repository root)
as it exists in the tree of commit_id.Source§fn submodules(&self) -> Result<Vec<SubmoduleInfo>>
fn submodules(&self) -> Result<Vec<SubmoduleInfo>>
Returns metadata for all submodules declared in
.gitmodules. Read moreSource§fn stash_entries(&self) -> Result<Vec<StashEntry>>
fn stash_entries(&self) -> Result<Vec<StashEntry>>
Returns all stash entries, newest first. Read more
Source§fn worktrees(&self) -> Result<Vec<WorktreeInfo>>
fn worktrees(&self) -> Result<Vec<WorktreeInfo>>
Returns all linked worktrees. The main worktree is not included. Read more
Source§fn operation_state(&self) -> Result<OperationState>
fn operation_state(&self) -> Result<OperationState>
Returns the current in-progress repository operation, if any. Read more
Source§fn unmerged_paths(&self) -> Result<Vec<PathBuf>>
fn unmerged_paths(&self) -> Result<Vec<PathBuf>>
Returns paths with unmerged (higher-stage) index entries. Read more
Source§fn conflict_summary(&self) -> Result<ConflictSummary>
fn conflict_summary(&self) -> Result<ConflictSummary>
Returns a structured summary of all conflicted index entries. Read more
Source§fn tree_at_commit(&self, commit_id: &CommitId) -> Result<Vec<TreeEntry>>
fn tree_at_commit(&self, commit_id: &CommitId) -> Result<Vec<TreeEntry>>
Non-recursive root-level tree listing at
commit_id, sorted ascending by name. Read moreSource§fn remotes(&self) -> Result<Vec<RemoteInfo>>
fn remotes(&self) -> Result<Vec<RemoteInfo>>
Returns all configured remotes, sorted ascending by name. Read more
Source§fn references(&self) -> Result<Vec<RefInfo>>
fn references(&self) -> Result<Vec<RefInfo>>
Returns all references, sorted ascending by full name. Read more
Source§fn references_by_kind(&self, kind: RefKind) -> Result<Vec<RefInfo>>
fn references_by_kind(&self, kind: RefKind) -> Result<Vec<RefInfo>>
Returns references matching
kind, sorted ascending by full name. Read moreSource§fn submodule_summaries(&self) -> Result<Vec<SubmoduleSummary>>
fn submodule_summaries(&self) -> Result<Vec<SubmoduleSummary>>
Returns rich metadata for each submodule, including initialization
and sync state. More expensive than
submodules.
Sorted ascending by path. Read moreSource§fn stash_detail(&self, index: usize) -> Result<StashDetail>
fn stash_detail(&self, index: usize) -> Result<StashDetail>
Returns detailed metadata for the stash entry at
index. Read moreSource§fn stash_diff(&self, index: usize) -> Result<DiffSummary>
fn stash_diff(&self, index: usize) -> Result<DiffSummary>
Returns a diff summary for the stash at
index vs its first parent. Read moreSource§fn worktree_details(&self) -> Result<Vec<WorktreeDetail>>
fn worktree_details(&self) -> Result<Vec<WorktreeDetail>>
Returns rich detail for all linked worktrees, sorted by id.
Missing worktrees are reported as
WorktreeState::MissingPath rather
than omitted. Read moreAuto Trait Implementations§
impl !Freeze for GitBackend
impl !RefUnwindSafe for GitBackend
impl !UnwindSafe for GitBackend
impl Send for GitBackend
impl Sync for GitBackend
impl Unpin for GitBackend
impl UnsafeUnpin for GitBackend
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