Implements the Git.Command behaviour for git am.
Applies a series of patches from mailbox-formatted files. Supports three-way merges, keeping subject prefixes, adding sign-off lines, and controlling in-progress am sessions (abort, continue, skip).
Summary
Types
Functions
Returns the argument list for git am.
When :abort, :continue_, or :skip is true, builds the corresponding
control command. Otherwise builds the full am command with all applicable
flags and patch file paths.
Examples
iex> Git.Commands.Am.args(%Git.Commands.Am{abort: true})
["am", "--abort"]
iex> Git.Commands.Am.args(%Git.Commands.Am{continue_: true})
["am", "--continue"]
iex> Git.Commands.Am.args(%Git.Commands.Am{skip: true})
["am", "--skip"]
iex> Git.Commands.Am.args(%Git.Commands.Am{patches: ["0001-fix.patch"]})
["am", "0001-fix.patch"]
iex> Git.Commands.Am.args(%Git.Commands.Am{patches: ["0001-fix.patch"], three_way: true, signoff: true})
["am", "--3way", "--signoff", "0001-fix.patch"]
iex> Git.Commands.Am.args(%Git.Commands.Am{directory: "/tmp/patches"})
["am", "/tmp/patches"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, :done} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git am.
On success (exit code 0), returns {:ok, :done}.
On failure, returns {:error, {stdout, exit_code}}.