Git.CountObjects (git v0.7.0)

Copy Markdown View Source

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.

Summary

Functions

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

Types

t()

@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()
}

Functions

parse(output)

@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}