Skip to content

Commit

Permalink
Merge pull request #14657 from MikeMcQuaid/tap_cask_api
Browse files Browse the repository at this point in the history
tap: return the default_remote if not installed.
  • Loading branch information
MikeMcQuaid committed Feb 16, 2023
2 parents 49a1dae + 53c57d7 commit 17c872f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/tap.rb
Expand Up @@ -134,7 +134,7 @@ def clear_cache
# The remote path to this {Tap}.
# e.g. `https://github.com/user/homebrew-repo`
def remote
raise TapUnavailableError, name unless installed?
return default_remote unless installed?

@remote ||= path.git_origin
end
Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/test/tap_spec.rb
Expand Up @@ -185,7 +185,6 @@ def setup_completion(link:)
setup_git_repo

expect(homebrew_foo_tap.remote).to eq("https://github.com/Homebrew/homebrew-foo")
expect { described_class.new("Homebrew", "bar").remote }.to raise_error(TapUnavailableError)
expect(homebrew_foo_tap).not_to have_custom_remote

services_tap = described_class.new("Homebrew", "services")
Expand Down Expand Up @@ -213,7 +212,6 @@ def setup_completion(link:)
setup_git_repo

expect(homebrew_foo_tap.remote_repo).to eq("Homebrew/homebrew-foo")
expect { described_class.new("Homebrew", "bar").remote_repo }.to raise_error(TapUnavailableError)

services_tap = described_class.new("Homebrew", "services")
services_tap.path.mkpath
Expand All @@ -228,7 +226,6 @@ def setup_completion(link:)
setup_git_repo

expect(homebrew_foo_tap.remote_repo).to eq("Homebrew/homebrew-foo")
expect { described_class.new("Homebrew", "bar").remote_repo }.to raise_error(TapUnavailableError)

services_tap = described_class.new("Homebrew", "services")
services_tap.path.mkpath
Expand Down

0 comments on commit 17c872f

Please sign in to comment.