pub struct Differ { /* private fields */ }Expand description
Wraps a git2::Repository and computes file-level change sets between commits.
Implementations§
Source§impl Differ
impl Differ
Sourcepub fn open(repo_path: &Path) -> Result<Self>
pub fn open(repo_path: &Path) -> Result<Self>
Open the repository at repo_path (or any parent that is a git repo).
Sourcepub fn changed_files(
&self,
from_sha: Option<&str>,
supported_exts: &[&str],
) -> Result<Vec<FileChange>>
pub fn changed_files( &self, from_sha: Option<&str>, supported_exts: &[&str], ) -> Result<Vec<FileChange>>
Compute which files changed between from_sha (exclusive) and HEAD.
from_sha = None— diff the empty tree against HEAD (first-time index).from_sha = Some(sha)— diff that commit against HEAD.
Only files whose extension is in supported_exts are returned.
Auto Trait Implementations§
impl !Sync for Differ
impl Freeze for Differ
impl RefUnwindSafe for Differ
impl Send for Differ
impl Unpin for Differ
impl UnsafeUnpin for Differ
impl UnwindSafe for Differ
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