# `Git.Commands.Maintenance`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/commands/maintenance.ex#L1)

Implements the `Git.Command` behaviour for `git maintenance`.

Runs, starts, stops, registers, or unregisters repository maintenance tasks
such as garbage collection, commit-graph updates, and prefetching.

# `t`

```elixir
@type t() :: %Git.Commands.Maintenance{
  auto: boolean(),
  quiet: boolean(),
  register_: boolean(),
  run: boolean(),
  schedule: String.t() | nil,
  start: boolean(),
  stop: boolean(),
  task: String.t() | nil,
  unregister: boolean()
}
```

# `args`

```elixir
@spec args(t()) :: [String.t()]
```

Returns the argument list for `git maintenance`.

## Examples

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{run: true})
    ["maintenance", "run"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{start: true})
    ["maintenance", "start"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{stop: true})
    ["maintenance", "stop"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{register_: true})
    ["maintenance", "register"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{unregister: true})
    ["maintenance", "unregister"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{run: true, task: "gc"})
    ["maintenance", "run", "--task", "gc"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{run: true, auto: true})
    ["maintenance", "run", "--auto"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{run: true, quiet: true})
    ["maintenance", "run", "--quiet"]

    iex> Git.Commands.Maintenance.args(%Git.Commands.Maintenance{run: true, schedule: "daily"})
    ["maintenance", "run", "--schedule", "daily"]

# `parse_output`

```elixir
@spec parse_output(String.t(), non_neg_integer()) ::
  {:ok, :done} | {:error, {String.t(), non_neg_integer()}}
```

Parses the output of `git maintenance`.

On success (exit code 0), returns `{:ok, :done}`. On failure, returns
`{:error, {stdout, exit_code}}`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
