Class: Git::Commands::ShowRef::Exists Private
- Defined in:
- lib/git/commands/show_ref/exists.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Requires git 2.43 or later
Earlier versions do not recognise the --exists flag and will exit
non-zero with an "unknown option" error.
arguments block audited against https://git-scm.com/docs/git-show-ref/2.53.0
Checks whether a single ref exists via git show-ref --exists
Returns without raising for three exit-status outcomes:
- exit 0 — the ref exists in the local repository
- exit 2 — the ref does not exist (a normal result for an existence check)
- exit 1 — a lookup error occurred (e.g. malformed ref name)
Callers inspect result.status.exitstatus to distinguish the three states.
Unlike Verify, this mode never prints any output.
For standard ref listing, use List. For strict per-ref verification with output, use Verify. For stdin-based filtering, use ExcludeExisting.
Instance Method Summary collapse
-
#call(ref, **options) ⇒ Git::CommandLineResult
Execute
git show-ref --existsto check whether a ref exists.
Methods inherited from Base
allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation
Constructor Details
This class inherits a constructor from Git::Commands::Base
Instance Method Details
#call(ref, **options) ⇒ Git::CommandLineResult
|
|
# File 'lib/git/commands/show_ref/exists.rb', line 54
|