Xgit v0.8.0 Xgit.Tag View Source

Represents a git tag object in memory.

Link to this section Summary

Types

Error response codes returned by from_object/1.

t()

This struct describes a single tag object so it can be manipulated in memory.

Functions

Renders a tag structure from an Xgit.Object.

Renders this tag structure into a corresponding Xgit.Object.

Return true if the value is a tag struct that is valid.

Return true if the value provided is valid as a tag name.

Link to this section Types

Link to this type

from_object_reason()

View Source
from_object_reason() :: :not_a_tag | :invalid_tag

Error response codes returned by from_object/1.

Link to this type

t()

View Source
t() :: %Xgit.Tag{
  message: [byte()],
  name: [byte()],
  object: Xgit.ObjectId.t(),
  tagger: Xgit.PersonIdent.t() | nil,
  type: Xgit.ObjectType.t()
}

This struct describes a single tag object so it can be manipulated in memory.

Struct Members

  • :object: (Xgit.ObjectId) object referenced by this tag
  • :type: (Xgit.ObjectType) type of the target object
  • :name: (bytelist) name of the tag
  • :tagger: (Xgit.PersonIdent) person who created the tag
  • :message: (bytelist) user-entered tag message (encoding unspecified)

TO DO: Support signatures and other extensions. https://github.com/elixir-git/xgit/issues/202

Link to this section Functions

Link to this function

from_object(object)

View Source
from_object(object :: Xgit.Object.t()) ::
  {:ok, tag :: t()} | {:error, from_object_reason()}

Renders a tag structure from an Xgit.Object.

Return Values

{:ok, tag} if the object contains a valid tag object.

{:error, :not_a_tag} if the object contains an object of a different type.

{:error, :invalid_tag} if the object says that is of type tag, but can not be parsed as such.

Link to this function

to_object(commit)

View Source
to_object(commit :: t()) :: Xgit.Object.t()

Renders this tag structure into a corresponding Xgit.Object.

If the tag structure is not valid, will raise ArgumentError.

Link to this function

valid?(tag)

View Source
valid?(tag :: any()) :: boolean()

Return true if the value is a tag struct that is valid.

Link to this function

valid_name?(name)

View Source
valid_name?(name :: any()) :: boolean()

Return true if the value provided is valid as a tag name.