Class: Git::Commands::SymbolicRef::Delete Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/symbolic_ref/delete.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.

Note:

arguments block audited against https://git-scm.com/docs/git-symbolic-ref/2.53.0

Deletes a symbolic ref via git symbolic-ref --delete

Removes the named symbolic ref. When quiet: true, exit status 1 (non-symbolic ref) does not produce an error message.

Examples:

Delete a symbolic ref

cmd = Git::Commands::SymbolicRef::Delete.new(execution_context)
cmd.call('HEAD')

See Also:

Instance Method Summary collapse

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(name, **options) ⇒ Git::CommandLineResult

Execute the git symbolic-ref --delete command

Parameters:

  • name (String)

    the symbolic ref name to delete (e.g. HEAD)

  • options (Hash)

    command options

Options Hash (**options):

  • :quiet (Boolean, nil) — default: nil

    suppress error message when the name is not a symbolic ref

    Alias: :q

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (ArgumentError)

    if the name operand is missing

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/symbolic_ref/delete.rb', line 41