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

Types

Reason codes that can be returned by run/2.

Functions

Read a tree object (and its descendants) and populate the index accordingly.

Link to this section Types

Link to this type

reason()

View Source
reason() ::
  :invalid_repository | :bare | Xgit.Repository.WorkingTree.read_tree_reason()

Reason codes that can be returned by run/2.

Link to this section Functions

Link to this function

run(repository, object_id, opts \\ [])

View Source
run(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:

TO DO

Implement --prefix option. https://github.com/elixir-git/xgit/issues/175