Skip to main content

GitBackend

Struct GitBackend 

Source
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§

Source§

impl GitBackend

Source

pub fn open(path: &Path) -> Result<Self>

Opens or discovers a Git repository at or above path.

Traverses parent directories until it finds a .git directory (or a bare repository), so callers may pass any subdirectory of the worktree.

Trait Implementations§

Source§

impl VcsBackend for GitBackend

Source§

fn status_digest(&self) -> Result<StatusDigest>

Source§

fn local_branches(&self) -> Result<Vec<BranchInfo>>

Source§

fn remote_branches(&self) -> Result<Vec<BranchInfo>>

Source§

fn list_commits(&self) -> Result<Vec<CommitInfo>>

Source§

fn list_commits_sorted(&self, order: SortOrder) -> Result<Vec<CommitInfo>>

Source§

fn log_since( &self, since: SystemTime, until: SystemTime, ) -> Result<Vec<CommitInfo>>

Source§

fn find_commit(&self, id: &CommitId) -> Result<CommitInfo>

Source§

fn list_tags(&self) -> Result<Vec<TagInfo>>

Source§

fn list_tags_sorted(&self, order: SortOrder) -> Result<Vec<TagInfo>>

Source§

fn create_tag(&self, name: &str) -> Result<()>

Source§

fn create_annotated_tag(&self, name: &str, message: &str) -> Result<()>

Source§

fn delete_tag(&self, name: &str) -> Result<()>

Source§

fn diff(&self, from: &CommitId, to: &CommitId) -> Result<DiffSummary>

Source§

fn remote_url(&self, name: &str) -> Option<String>

Source§

fn is_dirty(&self) -> Result<bool>

Returns true if the working tree has any uncommitted changes (staged or unstaged). Read more
Source§

fn merge_base(&self, a: &CommitId, b: &CommitId) -> Result<Option<CommitId>>

Returns the best common ancestor of commits a and b, or None if there is no shared history.
Source§

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 blame(&self, path: &Path) -> Result<Vec<BlameEntry>>

Returns per-line commit attribution for path at HEAD. Read more
Source§

fn worktree_status(&self) -> Result<WorktreeStatus>

Returns per-file working-tree status (staged changes, unstaged changes, and untracked files).
Source§

fn file_at_commit(&self, path: &Path, commit_id: &CommitId) -> Result<Vec<u8>>

Returns the raw content of path (relative to the repository root) as it exists in the tree of commit_id. Read more
Source§

fn submodules(&self) -> Result<Vec<SubmoduleInfo>>

Returns metadata for all submodules declared in .gitmodules. Returns an empty Vec when no submodules are configured.
Source§

fn stash_entries(&self) -> Result<Vec<StashEntry>>

Returns all stash entries (newest first), or an empty Vec if the stash is empty.
Source§

fn worktrees(&self) -> Result<Vec<WorktreeInfo>>

Returns all linked worktrees. The main worktree is not included. Returns an empty Vec for repositories with no linked worktrees.

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