Git.Commands.CountObjects (git v0.7.0)

Copy Markdown View Source

Implements the Git.Command behaviour for git count-objects.

Always runs in verbose mode (-v) so the full set of statistics is available for parsing into a Git.CountObjects struct.

Summary

Functions

Returns the argument list for git count-objects -v.

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

Types

t()

@type t() :: %Git.Commands.CountObjects{}

Functions

args(count_objects)

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

Returns the argument list for git count-objects -v.

Examples

iex> Git.Commands.CountObjects.args(%Git.Commands.CountObjects{})
["count-objects", "-v"]

parse_output(stdout, exit_code)

@spec parse_output(String.t(), non_neg_integer()) ::
  {:ok, Git.CountObjects.t()} | {:error, {String.t(), non_neg_integer()}}

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

On a non-zero exit code, returns {:error, {stdout, exit_code}}.