Xgit v0.2.5 Xgit.Plumbing.CatFile.Tree View Source
Retrieves a tree
object from a repository's object store.
Analogous to git cat-file -p
when the target object is a tree
object.
Link to this section Summary
Functions
Retrieves a tree
object from a repository's object store and renders
it as an Xgit.Core.Tree
struct.
Link to this section Types
reason()
View Sourcereason() :: :invalid_repository | :invalid_object_id | Xgit.Repository.get_object_reason() | Xgit.Core.Tree.from_object_reason()
Reason codes that can be returned by run/2
.
Link to this section Functions
run(repository, object_id)
View Sourcerun(repository :: Xgit.Repository.t(), object_id :: Xgit.Core.ObjectId.t()) :: {:ok, tree :: Xgit.Core.Tree.t()} | {:error, reason :: reason()}
Retrieves a tree
object from a repository's object store and renders
it as an Xgit.Core.Tree
struct.
Parameters
repository
is the Xgit.Repository
(PID) to search for the object.
object_id
is a string identifying the object.
Return Value
{:ok, tree}
if the object could be found and understood as a tree.
tree
is an instance of Xgit.Core.Tree
and can be used to retrieve
references to the members of that tree.
{:error, :invalid_repository}
if repository
doesn't represent a valid
Xgit.Repository
process.
{:error, :invalid_object_id}
if object_id
can't be parsed as a valid git object ID.
{:error, reason}
if otherwise unable. The relevant reason codes may come from: