Xgit v0.2.4 Xgit.Plumbing.WriteTree View Source
Write the index file as a tree
object.
Analogous to
git write-tree
.
Link to this section Summary
Functions
Translates the current working tree, as reflected in its index file, to one or more tree objects.
Link to this section Types
reason()
View Sourcereason() :: :invalid_repository | :bare | Xgit.Repository.WorkingTree.write_tree_reason() | Xgit.Core.DirCache.to_tree_objects_reason() | Xgit.Repository.WorkingTree.ParseIndexFile.from_iodevice_reason() | Xgit.Repository.put_loose_object_reason()
Reason codes that can be returned by run/2
.
Link to this section Functions
run(repository, opts \\ [])
View Sourcerun(repository :: Xgit.Repository.t(), missing_ok?: boolean(), prefix: Xgit.Core.FilePath.t() ) :: {:ok, object_id :: Xgit.Core.ObjectId.t()} | {:error, reason :: reason()}
Translates the current working tree, as reflected in its index file, to one or more tree objects.
The working tree must be in a fully-merged state.
Parameters
repository
is the Xgit.Repository
(PID) to search for the object.
Options
:missing_ok?
: true
to ignore any objects that are referenced by the index
file that are not present in the object database. Normally this would be an error.
:prefix
: (Xgit.Core.FilePath
) if present, returns the object_id
for the tree at
the given subdirectory. If not present, writes a tree corresponding to the root.
(The entire tree is written in either case.)
Return Value
{:ok, object_id}
with the object ID for the tree that was generated. (If the exact tree
specified by the index already existed, it will return that existing tree's ID.)
{: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: