Implements the Git.Command behaviour for git read-tree.
Loads tree contents into the index. It is the read side of the index/tree
pipeline behind commit_tree: read a tree into the index, adjust it (for
example with update-index), then write-tree it back out. -m does a
two- or three-way merge of up to three trees in the index.
Summary
Types
Functions
Returns the argument list for git read-tree.
Examples
iex> Git.Commands.ReadTree.args(%Git.Commands.ReadTree{trees: ["HEAD"]})
["read-tree", "HEAD"]
iex> Git.Commands.ReadTree.args(%Git.Commands.ReadTree{trees: ["a", "b"], merge: true, update: true})
["read-tree", "-m", "-u", "a", "b"]
iex> Git.Commands.ReadTree.args(%Git.Commands.ReadTree{trees: ["t"], prefix: "sub/"})
["read-tree", "--prefix=sub/", "t"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, :done} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git read-tree.
On success (exit code 0), returns {:ok, :done}. On failure, returns
{:error, {stdout, exit_code}}.