Implements the Git.Command behaviour for git mktree.
Builds a tree object from ls-tree-formatted entries fed on stdin and returns
its SHA, with no index or working tree. Together with hash_object and
commit_tree this lets a consumer synthesize whole trees and commits purely
from object SHAs (for example generated-content commits).
Reads stdin, so it needs the default Git.Runner.Forcola runner; under
Git.Runner.SystemCmd it returns {:error, :stdin_unsupported}.
Summary
Functions
Returns the argument list for git mktree.
Formats the entries for git mktree's stdin as <mode> <type> <object>\t<path>
lines. Empty entries feed empty stdin, which produces the empty tree.
Parses the output of git mktree.
Types
Functions
Returns the argument list for git mktree.
Examples
iex> Git.Commands.MkTree.args(%Git.Commands.MkTree{})
["mktree"]
iex> Git.Commands.MkTree.args(%Git.Commands.MkTree{missing: true})
["mktree", "--missing"]
Formats the entries for git mktree's stdin as <mode> <type> <object>\t<path>
lines. Empty entries feed empty stdin, which produces the empty tree.
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, String.t()} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git mktree.
On success (exit code 0), returns {:ok, sha} with the trimmed tree SHA. On
failure, returns {:error, {stdout, exit_code}}.