Xgit v0.2.5 Xgit.Plumbing.CatFile View Source
Retrieves the content, type, and size information for a single object in a repository's object store.
Analogous to the first form of git cat-file
.
Link to this section Summary
Functions
Retrieves the content, type, and size information for a single object in a repository's object store.
Link to this section Types
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, Xgit.Core.Object} | {:error, reason :: reason()} | {:error, reason :: Xgit.Repository.get_object_reason()}
Retrieves the content, type, and size information for a single object in a repository's object store.
Parameters
repository
is the Xgit.Repository
(PID) to search for the object.
object_id
is a string identifying the object.
Return Value
{:ok, object}
if the object could be found. object
is an instance of
Xgit.Core.Object
and can be used to retrieve content and other information
about the underlying git object.
{: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, :not_found}
if the object does not exist in the database.
{:error, :invalid_object}
if object was found, but invalid.