Implements the Git.Command behaviour for git bundle.
Supports creating, verifying, listing heads of, and unbundling git bundles.
Uses the process dictionary to communicate the operation mode from args/1
to parse_output/2.
Summary
Types
Functions
Returns the argument list for git bundle.
Examples
iex> Git.Commands.Bundle.args(%Git.Commands.Bundle{create: "/tmp/test.bundle", rev: "HEAD"})
["bundle", "create", "/tmp/test.bundle", "HEAD"]
iex> Git.Commands.Bundle.args(%Git.Commands.Bundle{create: "/tmp/test.bundle", all: true})
["bundle", "create", "/tmp/test.bundle", "--all"]
iex> Git.Commands.Bundle.args(%Git.Commands.Bundle{verify: "/tmp/test.bundle"})
["bundle", "verify", "/tmp/test.bundle"]
iex> Git.Commands.Bundle.args(%Git.Commands.Bundle{list_heads: "/tmp/test.bundle"})
["bundle", "list-heads", "/tmp/test.bundle"]
iex> Git.Commands.Bundle.args(%Git.Commands.Bundle{unbundle: "/tmp/test.bundle"})
["bundle", "unbundle", "/tmp/test.bundle"]
iex> Git.Commands.Bundle.args(%Git.Commands.Bundle{create: "/tmp/test.bundle", rev: "HEAD", quiet: true})
["bundle", "create", "-q", "/tmp/test.bundle", "HEAD"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, term()} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git bundle.
- create (exit 0):
{:ok, :done} - verify (exit 0):
{:ok, %{valid: true, raw: stdout}} - verify (exit 1):
{:ok, %{valid: false, raw: stdout}} - list-heads (exit 0):
{:ok, [%{sha: String.t(), ref: String.t()}]} - unbundle (exit 0):
{:ok, :done}