diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 6b7375e25b..bc5cd52425 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -1468,7 +1468,8 @@ class DownloadStrategyDetector GitHubGitDownloadStrategy when %r{^https?://.+\.git$}, %r{^git://}, - %r{^https?://git\.sr\.ht/[^/]+/[^/]+$} + %r{^https?://git\.sr\.ht/[^/]+/[^/]+$}, + %r{^ssh://git} GitDownloadStrategy when %r{^https?://www\.apache\.org/dyn/closer\.cgi}, %r{^https?://www\.apache\.org/dyn/closer\.lua} diff --git a/Library/Homebrew/test/download_strategies/detector_spec.rb b/Library/Homebrew/test/download_strategies/detector_spec.rb index 7bf0604fe7..aaf84f2784 100644 --- a/Library/Homebrew/test/download_strategies/detector_spec.rb +++ b/Library/Homebrew/test/download_strategies/detector_spec.rb @@ -15,6 +15,12 @@ RSpec.describe DownloadStrategyDetector do it { is_expected.to eq(GitDownloadStrategy) } end + context "when given SSH Git URL" do + let(:url) { "ssh://git@example.com/foo.git" } + + it { is_expected.to eq(GitDownloadStrategy) } + end + context "when given a GitHub Git URL" do let(:url) { "https://github.com/homebrew/brew.git" }