Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tap: return the default_remote if not installed. #14657

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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