add ssh://git scheme for git download strategy

This commit is contained in:
Daeho Ro 2024-04-21 18:42:25 +09:00
parent 8810b7f041
commit 5680ffe2e6
2 changed files with 8 additions and 1 deletions

View File

@ -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}

View File

@ -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" }