Xgit v0.8.0 Xgit.Commit View Source
Represents a git commit object in memory.
Link to this section Summary
Types
Error response codes returned by from_object/1.
This struct describes a single commit object so it can be manipulated in memory.
Functions
Renders a commit structure from an Xgit.Object.
Renders this commit structure into a corresponding Xgit.Object.
Return true if the value is a commit struct that is valid.
Link to this section Types
from_object_reason()
View Sourcefrom_object_reason() :: :not_a_commit | :invalid_commit
Error response codes returned by from_object/1.
t()
View Sourcet() :: %Xgit.Commit{
author: Xgit.PersonIdent.t(),
committer: Xgit.PersonIdent.t(),
message: [byte()],
parents: [Xgit.ObjectId.t()],
tree: Xgit.ObjectId.t()
}
This struct describes a single commit object so it can be manipulated in memory.
Struct Members
:tree: (Xgit.ObjectId) tree referenced by this commit:parents: (list ofXgit.ObjectId) parent(s) of this commit:author: (Xgit.PersonIdent) author of this commit:committer: (Xgit.PersonIdent) committer for this commit:message: (bytelist) user-entered commit message (encoding unspecified)
TO DO: Support signatures and other extensions. https://github.com/elixir-git/xgit/issues/202
Link to this section Functions
from_object(object)
View Sourcefrom_object(object :: Xgit.Object.t()) :: {:ok, commit :: t()} | {:error, from_object_reason()}
Renders a commit structure from an Xgit.Object.
Return Values
{:ok, commit} if the object contains a valid commit object.
{:error, :not_a_commit} if the object contains an object of a different type.
{:error, :invalid_commit} if the object says that is of type commit, but
can not be parsed as such.
Renders this commit structure into a corresponding Xgit.Object.
If duplicate parents are detected, they will be silently de-duplicated.
If the commit structure is not valid, will raise ArgumentError.
Return true if the value is a commit struct that is valid.