Xgit v0.3.0 Xgit.Core.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.Core.Object
.
Renders this commit structure into a corresponding Xgit.Core.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.Core.Commit{ author: Xgit.Core.PersonIdent.t(), committer: Xgit.Core.PersonIdent.t(), message: [byte()], parents: [Xgit.Core.ObjectId.t()], tree: Xgit.Core.ObjectId.t() }
This struct describes a single commit
object so it can be manipulated in memory.
Struct Members
:tree
: (Xgit.Core.ObjectId
) tree referenced by this commit:parents
: (list ofXgit.Core.ObjectId
) parent(s) of this commit:author
: (Xgit.Core.PersonIdent
) author of this commit:committer
: (Xgit.Core.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.Core.Object.t()) :: {:ok, commit :: t()} | {:error, from_object_reason()}
Renders a commit structure from an Xgit.Core.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.
to_object(commit)
View Sourceto_object(commit :: t()) :: Xgit.Core.Object.t()
Renders this commit structure into a corresponding Xgit.Core.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.