Implements the Git.Command behaviour for git rm.
Supports removing tracked files from the index and optionally from the working tree, with options for cached-only removal, force, recursive, dry-run, quiet output, and pathspec-from-file.
Summary
Types
Functions
Returns the argument list for git rm.
Builds git rm [options] [--] <files> from the struct fields.
Examples
iex> Git.Commands.Rm.args(%Git.Commands.Rm{files: ["a.txt"]})
["rm", "a.txt"]
iex> Git.Commands.Rm.args(%Git.Commands.Rm{files: ["a.txt"], cached: true})
["rm", "--cached", "a.txt"]
iex> Git.Commands.Rm.args(%Git.Commands.Rm{files: ["dir/"], recursive: true, force: true})
["rm", "-f", "-r", "dir/"]
iex> Git.Commands.Rm.args(%Git.Commands.Rm{files: [], pathspec_from_file: "paths.txt"})
["rm", "--pathspec-from-file", "paths.txt"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, :done} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git rm.
On success (exit code 0), returns {:ok, :done}. On failure, returns
{:error, {stdout, exit_code}}.