Xgit v0.2.4 Xgit.Plumbing.ReadTree View Source
Read a tree
object (and its descendants) and populate the index accordingly.
Analogous to
git read-tree
.
Link to this section Summary
Functions
Read a tree
object (and its descendants) and populate the index accordingly.
Link to this section Types
reason()
View Sourcereason() :: :invalid_repository | :bare | Xgit.Repository.WorkingTree.read_tree_reason()
Reason codes that can be returned by run/2
.
Link to this section Functions
run(repository, object_id, opts \\ [])
View Sourcerun(repository :: Xgit.Repository.t(), object_id :: Xgit.Core.ObjectId.t(), [ {:missing_ok?, boolean()} ]) :: :ok | {:error, reason :: reason()}
Read a tree
object (and its descendants) and populate the index accordingly.
Does not update files in the working tree itself.
Analogous to git read-tree
.
Parameters
repository
is the Xgit.Repository
(PID) to search for the object.
object_id
is the object ID of the root working tree. The special name :empty
may be used to empty the index.
Options
:missing_ok?
: true
to ignore any objects that are referenced by the tree
structures that are not present in the object database. Normally this would be an error.
Return Value
:ok
if successful.
{:error, :invalid_repository}
if repository
doesn't represent a valid
Xgit.Repository
process.
{:error, :bare}
if repository
doesn't have a working tree.
Reason codes may also come from the following functions:
Xgit.Core.Tree.from_object/1
Xgit.Repository.get_object/2
Xgit.Repository.WorkingTree.read_tree/3
Xgit.Repository.WorkingTree.WriteIndexFile.to_iodevice/2
TO DO
Implement --prefix
option. https://github.com/elixir-git/xgit/issues/175