From 53c57d7a7023a216196e35a1fae30d76370cc16e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 16 Feb 2023 12:25:28 +0000 Subject: [PATCH] tap: return the default_remote if not installed. Fixes #14656. --- Library/Homebrew/tap.rb | 2 +- Library/Homebrew/test/tap_spec.rb | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index c14dc4a4b1..cc70e67acf 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -134,7 +134,7 @@ class Tap # 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 diff --git a/Library/Homebrew/test/tap_spec.rb b/Library/Homebrew/test/tap_spec.rb index 5223091291..b13ee778b3 100644 --- a/Library/Homebrew/test/tap_spec.rb +++ b/Library/Homebrew/test/tap_spec.rb @@ -185,7 +185,6 @@ describe Tap do 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") @@ -213,7 +212,6 @@ describe Tap do 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 @@ -228,7 +226,6 @@ describe Tap do 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