[][src]Struct git_checks::Commit

pub struct Commit {
    pub sha1: CommitId,
    pub message: String,
    pub parents: Vec<CommitId>,
    pub diffs: Vec<DiffInfo>,
    pub author: Identity,
    pub committer: Identity,
    // some fields omitted

Representation of a commit with information useful for commit checks.


sha1: CommitId

The SHA1 of the commit.

message: String

The commit message.

parents: Vec<CommitId>

The parents of the commit.

diffs: Vec<DiffInfo>

Information about files that changed in this commit.

author: Identity

The identity of the author.

committer: Identity

The identity of the commiter.


impl Commit[src]

pub fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self>[src]

Create a new commit from the given context for the SHA1.

pub fn changed_files(&self) -> Vec<&FileName>[src]

Deprecated since 2.3.0:

please use the Content::modified_files trait method instead

Return a vector of files changed by the commit.

This excludes paths which are either not actually files (e.g., submodules and symlinks), as well as paths which were deleted in this commit.

pub fn file_patch<P>(&self, path: P) -> Result<String> where
    P: AsRef<OsStr>, 

Get the patch difference for the given path.

Trait Implementations

impl Content for Commit[src]

fn modified_files(&self) -> Vec<&FileName>[src]

Return a vector of files modified in a diff. Read more

impl Debug for Commit[src]

Auto Trait Implementations

impl Send for Commit

impl Unpin for Commit

impl Sync for Commit

impl UnwindSafe for Commit

impl RefUnwindSafe for Commit

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized