Class: Git::Commands::Remote::SetUrlDelete Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/remote/set_url_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-remote/2.53.0

git remote set-url --delete command

Removes all URLs matching a regex from the named remote's configured URL list. By default operates on fetch URLs; pass push: true to target push URLs instead.

Examples:

Delete a fetch URL matching a pattern

set_url_delete = Git::Commands::Remote::SetUrlDelete.new(execution_context)
set_url_delete.call('origin', 'github')

Delete a push URL matching a pattern

set_url_delete = Git::Commands::Remote::SetUrlDelete.new(execution_context)
set_url_delete.call('origin', 'github', push: true)

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

Execute the git remote set-url --delete command

Parameters:

  • name (String)

    the remote name to update

  • url (String)

    a regex selecting the URL or URLs to delete

  • options (Hash)

    command options

Options Hash (**options):

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

    delete push URLs instead of fetch URLs

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status



# File 'lib/git/commands/remote/set_url_delete.rb', line 42