pub struct GitHistory;Expand description
GitHistory discovers files that have changed relative to a git ref
(typically HEAD). Used by --diff HEAD so spec-drift can focus reports on
changed files and drift plausibly induced by changed implementation.
Shelling out to git keeps us free of a linked libgit dependency. When git
is unavailable or the repo has no history, every method returns None and
the caller falls back to a full-tree walk.
Implementations§
Source§impl GitHistory
impl GitHistory
Sourcepub fn changed_files(root: &Path, reference: &str) -> Option<HashSet<PathBuf>>
pub fn changed_files(root: &Path, reference: &str) -> Option<HashSet<PathBuf>>
Return the set of tracked files changed between reference and the
working tree, plus untracked files that are not ignored. None means
“can’t answer — fall back to a full walk” (git missing, not a repo,
unknown ref, etc.).
Sourcepub fn narrow(
files: DiscoveredFiles,
changed: &HashSet<PathBuf>,
) -> DiscoveredFiles
pub fn narrow( files: DiscoveredFiles, changed: &HashSet<PathBuf>, ) -> DiscoveredFiles
Filter every bucket in files to only paths present in changed.
Invariant: buckets stay sorted.
Auto Trait Implementations§
impl Freeze for GitHistory
impl RefUnwindSafe for GitHistory
impl Send for GitHistory
impl Sync for GitHistory
impl Unpin for GitHistory
impl UnsafeUnpin for GitHistory
impl UnwindSafe for GitHistory
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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