# `Git.CountObjects`
[🔗](https://github.com/joshrotenberg/git_wrapper_ex/blob/main/lib/git/count_objects.ex#L1)

Parsed representation of `git count-objects -v` output.

Reports the number and on-disk size of loose and packed objects. Sizes are
reported by git in KiB. Fields default to `0` when git omits the
corresponding line.

# `t`

```elixir
@type t() :: %Git.CountObjects{
  count: non_neg_integer(),
  garbage: non_neg_integer(),
  in_pack: non_neg_integer(),
  packs: non_neg_integer(),
  prune_packable: non_neg_integer(),
  size: non_neg_integer(),
  size_garbage: non_neg_integer(),
  size_pack: non_neg_integer()
}
```

# `parse`

```elixir
@spec parse(String.t()) :: t()
```

Parses the verbose output of `git count-objects -v` into a struct.

Each line has the form `key: value`. Unknown keys are ignored.

## Examples

    iex> Git.CountObjects.parse("count: 3\nsize: 12\nin-pack: 0\npacks: 0\nsize-pack: 0\nprune-packable: 0\ngarbage: 0\nsize-garbage: 0\n")
    %Git.CountObjects{count: 3, size: 12}

---

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