Struct git_checks::Commit
[−]
[src]
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.
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.
Methods
impl Commit
[src]
fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self>
[src]
Create a new commit from the given context for the SHA1.
fn changed_files(&self) -> Vec<&FileName>
[src]
: 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.
fn file_patch<P>(&self, path: P) -> Result<String> where
P: AsRef<OsStr>,
[src]
P: AsRef<OsStr>,
Get the patch difference for the given path.
Trait Implementations
impl Debug for Commit
[src]
impl Content for Commit
[src]
fn workarea(&self, ctx: &GitContext) -> Result<GitWorkArea>
[src]
A workarea which may be used to work on the content.
fn sha1(&self) -> Option<&CommitId>
[src]
The SHA1 of the commit (if the content is of a commit).
fn diffs(&self) -> &Vec<DiffInfo>
[src]
The differences in the content.
fn path_diff(&self, path: &FileName) -> Result<String>
[src]
Get the patch difference for the given path.
fn modified_files(&self) -> Vec<&FileName>
[src]
Return a vector of files modified in a diff. Read more