Implements the Git.Command behaviour for git symbolic-ref.
Reads, creates, or deletes symbolic refs. A symbolic ref is a ref that points to another ref (e.g., HEAD typically points to a branch).
Summary
Types
Functions
Returns the argument list for git symbolic-ref.
Examples
iex> Git.Commands.SymbolicRef.args(%Git.Commands.SymbolicRef{ref: "HEAD"})
["symbolic-ref", "HEAD"]
iex> Git.Commands.SymbolicRef.args(%Git.Commands.SymbolicRef{ref: "HEAD", short: true})
["symbolic-ref", "--short", "HEAD"]
iex> Git.Commands.SymbolicRef.args(%Git.Commands.SymbolicRef{ref: "HEAD", target: "refs/heads/main"})
["symbolic-ref", "HEAD", "refs/heads/main"]
iex> Git.Commands.SymbolicRef.args(%Git.Commands.SymbolicRef{ref: "HEAD", delete: true})
["symbolic-ref", "--delete", "HEAD"]
iex> Git.Commands.SymbolicRef.args(%Git.Commands.SymbolicRef{ref: "HEAD", quiet: true})
["symbolic-ref", "--quiet", "HEAD"]
@spec parse_output(String.t(), non_neg_integer()) :: {:ok, String.t() | :done} | {:error, {String.t(), non_neg_integer()}}
Parses the output of git symbolic-ref.
For reads (exit code 0 with output), returns {:ok, ref_string} trimmed.
For writes and deletes (exit code 0 with no output), returns {:ok, :done}.
On failure, returns {:error, {stdout, exit_code}}.