Xgit v0.7.1 Xgit.ObjectType View Source

Describes the known git object types.

There are four distinct object types that can be stored in a git repository. Xgit communicates internally about these object types using the following atoms:

  • :blob
  • :tree
  • :commit
  • :tag

This module is intended to be used. Doing so will create an alias to the module so as to make ObjectType.t available for typespecs and will import the is_object_type/1 guard.

Link to this section Summary

Types

t()

One of the four known git object types, expressed as an atom.

Functions

Parses a byte list and converts it to an object-type atom.

This guard requires the value to be one of the four known git object types.

Return true if the value is one of the four known git object types.

Link to this section Types

Link to this type

t()

View Source
t() :: :blob | :tree | :commit | :tag

One of the four known git object types, expressed as an atom.

Link to this section Functions

Link to this function

from_bytelist(value)

View Source
from_bytelist(value :: [byte()]) :: t() | :error

Parses a byte list and converts it to an object-type atom.

Returns :error if the byte list doesn't match any of the known-valid object types.

Link to this macro

is_object_type(t)

View Source (macro)

This guard requires the value to be one of the four known git object types.

Return true if the value is one of the four known git object types.