class Git::Commands::ShowRef::Verify

Strict per-ref verification command via ‘git show-ref –verify`

Verifies that refs exist by their full canonical name (e.g. ‘refs/heads/main`, `refs/tags/v1.0`). Unlike {ShowRef::List}, partial name matching is not performed. Every named ref must start with `refs/` (or be `HEAD`); anything else will cause git to exit non-zero.

When a ref cannot be resolved, git exits 1 and this class raises {Git::FailedError}. This strict behaviour makes the class suitable for validating that refs are fully qualified.

For pattern-based listing, use {ShowRef::List}. For stdin-based filtering, use {ShowRef::ExcludeExisting}. For a silent boolean check (git >= 2.43), use {ShowRef::Exists}.

@example Verify a single ref

cmd = Git::Commands::ShowRef::Verify.new(execution_context)
result = cmd.call('refs/heads/main')
result.stdout  # => "abc1234 refs/heads/main\n"

@example Verify with hash-only output

cmd = Git::Commands::ShowRef::Verify.new(execution_context)
result = cmd.call('refs/heads/main', hash: true)
result.stdout  # => "abc1234\n"

@example Silent existence check

cmd = Git::Commands::ShowRef::Verify.new(execution_context)
cmd.call('refs/heads/main', quiet: true)  # raises FailedError if not found

@note ‘arguments` block audited against git-scm.com/docs/git-show-ref/2.53.0

@see Git::Commands::ShowRef

@see git-scm.com/docs/git-show-ref git-show-ref documentation

@api private