Struct git_checks_core::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, CommitError>
pub fn new(ctx: &GitContext, sha1: &CommitId) -> Result<Self, CommitError>
Create a new commit from the given context for the SHA1.
sourcepub fn file_patch<P>(&self, path: P) -> Result<String, CommitError>
pub fn file_patch<P>(&self, path: P) -> Result<String, CommitError>
Get the patch difference for the given path.
Trait Implementations§
source§impl Content for Commit
impl Content for Commit
source§fn workarea(&self, ctx: &GitContext) -> Result<GitWorkArea, WorkAreaError>
fn workarea(&self, ctx: &GitContext) -> Result<GitWorkArea, WorkAreaError>
A workarea which may be used to work on the content.
Auto Trait Implementations§
impl Freeze for Commit
impl RefUnwindSafe for Commit
impl Send for Commit
impl Sync for Commit
impl Unpin for Commit
impl UnwindSafe for Commit
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