Skip to main content

GitCliRepo

Struct GitCliRepo 

pub struct GitCliRepo { /* private fields */ }

Implementations§

§

impl GitCliRepo

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

Trait Implementations§

§

impl Repo for GitCliRepo

§

fn walk_commits<'a>( &'a self, opts: &'a Options, ) -> Result<Box<dyn Iterator<Item = Result<CommitEvent>> + Send + 'a>>

Walk commits matching opts.after/opts.before. Returns an iterator over the resulting commit events.
§

fn changed_files(&self, rev: &str) -> Result<Vec<FileChange>>

Per-file changes for one commit.
§

fn diff_hunks(&self, rev: &str, path: &str) -> Result<Vec<Hunk>>

Hunks within one (commit, path) pair.
§

fn resolve_alias(&self, name: &str, email: &str) -> String

.mailmap-aware author identity canonicalization. Returns the canonical email for the given (name, email) pair after applying any matching .mailmap rule. Read more
§

fn head_sha(&self) -> Result<String>

Return the full SHA-1 hex string of HEAD. Used by the persistent cache to build the cache key.
§

fn is_worktree_dirty(&self) -> bool

Whether tracked content differs from HEAD — staged changes (index vs. HEAD) or unstaged changes (worktree vs. index). Untracked files are excluded: every caller (the calibrate-defects mining guard, the cache-hit staleness warning, the dirty cache-write skip) protects HEAD-time metrics computed over tracked_paths_at_head() only. Exception: a submodule whose only change is untracked content in its own worktree may report dirty (backend-dependent). Read more
§

fn merge_or_rebase_in_progress(&self) -> bool

Whether the repository is partway through a merge, rebase, cherry-pick, or revert — an ambiguous-HEAD state where the working tree and HEAD no longer describe one coherent commit. True when any of MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD, rebase-merge/, or rebase-apply/ is present in the repository’s git dir (worktree- correct: a linked worktree keeps this state in its own git dir, not the common one). Read more
§

fn read_blob_at(&self, rev: &str, path: &str) -> Result<Option<Vec<u8>>>

Read the blob bytes at revision rev for path (POSIX- separated, repo-relative). rev is any git revision the backend can resolve — a commit SHA, "HEAD", a tag, etc. Returns Ok(None) if the path isn’t a tracked blob at that revision (deleted there, a directory, or a submodule gitlink). Returns Err only on real object-database I/O failure (corrupted pack, missing shallow object) — NOT on “path doesn’t exist at rev”. Read more
§

fn worktree_changes(&self) -> Result<Vec<WorktreeChange>>

Enumerate tracked working-tree changes vs HEAD (union of staged and unstaged, net-classified; untracked files excluded; symlinks and submodule pointers excluded; sorted by path). Errors on unmerged (conflict) entries. Hint quality: backends agree via differential tests. Read more
§

fn tracked_paths_at_head(&self) -> Result<Vec<String>>

Every regular-file blob path (the 0o100xxx mode class — canonical 100644/100755 plus legacy non-canonical variants like 100664) in the HEAD commit’s tree, repo-relative with / separators, sorted ascending. Symlinks (120000) and submodule gitlinks (160000) are excluded — neither carries source bytes the HEAD-time scans can parse. Read more
§

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

Return all git tags in this repository, sorted ascending by date, tie-broken via [tag_tiebreak_cmp] for same-date tags. Read more
§

fn is_shallow(&self) -> bool

Whether the repository is a shallow clone — history truncated at a depth boundary, with a non-empty .git/shallow grafts list, so commits beyond the boundary (and the parents of the boundary commits) are absent. Read more
§

fn read_blob_at_head(&self, path: &str) -> Result<Option<Vec<u8>>>

Read the blob bytes at HEAD for path. Convenience wrapper over read_blob_at — the HEAD-time scans’ entry point. Backends override read_blob_at, not this. Read more
§

fn blob_reader_at<'a>(&'a self, rev: &str) -> Box<dyn BlobReader + 'a>

Open a reader for many blobs at rev without re-resolving rev→commit→root-tree on every call. Construction is INFALLIBLE (resolution happens lazily on the first BlobReader::read) so it slots directly into rayon’s map_init idiom — the HEAD-time scans build one per worker thread and reuse it across every file that worker processes. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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