From 5680ffe2e62eb58e0ef130ad226077c17d814bc4 Mon Sep 17 00:00:00 2001 From: Daeho Ro Date: Sun, 21 Apr 2024 18:42:25 +0900 Subject: [PATCH] add ssh://git scheme for git download strategy --- Library/Homebrew/download_strategy.rb | 3 ++- Library/Homebrew/test/download_strategies/detector_spec.rb | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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" }