Implements the Git.Command behaviour for git restore.
git restore is the modern (Git 2.23+) command for restoring working tree
files, replacing the file-restoration role of git checkout. It provides
explicit control over restoring from the index (staged) vs a source commit.
Summary
Types
Functions
Returns the argument list for git restore.
Examples
iex> Git.Commands.Restore.args(%Git.Commands.Restore{files: ["README.md"]})
["restore", "README.md"]
iex> Git.Commands.Restore.args(%Git.Commands.Restore{files: ["lib/foo.ex"], staged: true})
["restore", "--staged", "lib/foo.ex"]
iex> Git.Commands.Restore.args(%Git.Commands.Restore{files: ["lib/foo.ex"], source: "HEAD~1"})
["restore", "--source", "HEAD~1", "lib/foo.ex"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, :done} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git restore.
git restore produces no stdout on success (exit 0), so we return {:ok, :done}.