Git.Commands.VerifyTag (git v0.4.0)

Copy Markdown View Source

Implements the Git.Command behaviour for git verify-tag.

Verifies the GPG signature of a tag object.

Summary

Functions

Returns the argument list for git verify-tag.

Parses the output of git verify-tag.

Types

t()

@type t() :: %Git.Commands.VerifyTag{
  format: String.t() | nil,
  raw: boolean(),
  tag: String.t() | nil,
  verbose: boolean()
}

Functions

args(command)

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

Returns the argument list for git verify-tag.

Examples

iex> Git.Commands.VerifyTag.args(%Git.Commands.VerifyTag{tag: "v1.0"})
["verify-tag", "v1.0"]

iex> Git.Commands.VerifyTag.args(%Git.Commands.VerifyTag{tag: "v1.0", verbose: true})
["verify-tag", "-v", "v1.0"]

iex> Git.Commands.VerifyTag.args(%Git.Commands.VerifyTag{tag: "v1.0", raw: true})
["verify-tag", "--raw", "v1.0"]

iex> Git.Commands.VerifyTag.args(%Git.Commands.VerifyTag{tag: "v1.0", format: "%(objectname)"})
["verify-tag", "--format=%(objectname)", "v1.0"]

parse_output(stdout, exit_code)

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

Parses the output of git verify-tag.

Exit code 0 means the tag has a valid GPG signature. Exit code 1 means the signature is bad or missing. Other exit codes are treated as errors.