Struct git2::Commit [−][src]
pub struct Commit<'repo> { /* fields omitted */ }
Expand description
A structure to represent a git commit
Implementations
Get the id of the tree pointed to by this commit.
No attempts are made to fetch an object from the ODB.
Get access to the underlying raw pointer.
Get the full message of a commit.
The returned message will be slightly prettified by removing any potential leading newlines.
None
will be returned if the message is not valid utf-8
Get the full message of a commit as a byte slice.
The returned message will be slightly prettified by removing any potential leading newlines.
Get the encoding for the message of a commit, as a string representing a standard encoding name.
None
will be returned if the encoding is not known
Get the full raw message of a commit.
None
will be returned if the message is not valid utf-8
Get the full raw message of a commit.
Get the full raw text of the commit header.
None
will be returned if the message is not valid utf-8
Get the full raw text of the commit header.
Get the short “summary” of the git commit message.
The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.
None
may be returned if an error occurs or if the summary is not valid
utf-8.
Get the short “summary” of the git commit message.
The returned message is the summary of the commit, comprising the first paragraph of the message with whitespace trimmed and squashed.
None
may be returned if an error occurs
Get the commit time (i.e. committer time) of a commit.
The first element of the tuple is the time, in seconds, since the epoch. The second element is the offset, in minutes, of the time zone of the committer’s preferred time zone.
Creates a new iterator over the parents of this commit.
Creates a new iterator over the parents of this commit.
Get the author of this commit.
Amend this existing commit with all non-None
values
This creates a new commit that is exactly the same as the old commit,
except that any non-None
values will be updated. The new commit has
the same parents as the old commit.
For information about update_ref
, see Repository::commit
.
Get the number of parents of this commit.
Use the parents
iterator to return an iterator over all parents.
Get the specified parent of the commit.
Use the parents
iterator to return an iterator over all parents.
Get the specified parent id of the commit.
This is different from parent
, which will attempt to load the
parent commit from the ODB.
Use the parent_ids
iterator to return an iterator over all parents.
Consumes Commit to be returned as an Object
Trait Implementations
Auto Trait Implementations
impl<'repo> RefUnwindSafe for Commit<'repo>
impl<'repo> UnwindSafe for Commit<'repo>
Blanket Implementations
Mutably borrows from an owned value. Read more