Implements the Git.Command behaviour for git diff-tree.
Compares the content and mode of blobs found via two tree-ish arguments,
or (with a single tree-ish) a commit against its first parent. Output is
requested with --raw -z and parsed into Git.DiffRawEntry structs.
Summary
Types
Functions
Returns the argument list for git diff-tree.
Options:
:tree_ish- the first (or only) tree-ish to diff (default"HEAD"):tree_ish2- a second tree-ish; when set, diffstree_ish tree_ish2:recursive- adds-rto recurse into subtrees (defaultfalse):find_renames- adds-Mto detect renames (defaultfalse)
Examples
iex> Git.Commands.DiffTree.args(%Git.Commands.DiffTree{})
["diff-tree", "--raw", "-z", "HEAD"]
iex> Git.Commands.DiffTree.args(%Git.Commands.DiffTree{recursive: true})
["diff-tree", "--raw", "-z", "-r", "HEAD"]
iex> Git.Commands.DiffTree.args(%Git.Commands.DiffTree{tree_ish: "HEAD~1", tree_ish2: "HEAD", recursive: true})
["diff-tree", "--raw", "-z", "-r", "HEAD~1", "HEAD"]
iex> Git.Commands.DiffTree.args(%Git.Commands.DiffTree{find_renames: true, recursive: true})
["diff-tree", "--raw", "-z", "-r", "-M", "HEAD"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, [Git.DiffRawEntry.t()]} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git diff-tree --raw -z.
On success (exit code 0), returns {:ok, [Git.DiffRawEntry.t()]}.
On failure, returns {:error, {stdout, exit_code}}.