Struct git_checks::impl_prelude::Commit
source · pub struct Commit {
pub sha1: CommitId,
pub message: String,
pub parents: Vec<CommitId>,
pub diffs: Vec<DiffInfo>,
pub author: Identity,
pub committer: Identity,
/* private fields */
}
Expand description
Representation of a commit with information useful for commit checks.
Fields§
§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.
The identity of the author.
committer: Identity
The identity of the commiter.
Implementations§
source§impl Commit
impl Commit
sourcepub fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self>
pub fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self>
Create a new commit from the given context for the SHA1.
sourcepub fn changed_files(&self) -> Vec<&FileName> ⓘ
👎Deprecated since 2.3.0: please use the Content::modified_files
trait method instead
pub fn changed_files(&self) -> Vec<&FileName> ⓘ
Content::modified_files
trait method insteadReturn 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.