Skip to content

Commit

Permalink
Add test for fix for rubygems#7547
Browse files Browse the repository at this point in the history
  • Loading branch information
llenk committed May 8, 2024
1 parent e997ffe commit 5ef9f00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bundler/spec/bundler/source/git/git_proxy_spec.rb
Expand Up @@ -197,4 +197,18 @@

expect(Pathname.new(bundled_app("canary"))).not_to exist
end

context "URI is HTTP" do
let(:uri) { "http://github.com/rubygems/rubygems.git" }
let(:without_depth_arguments) { ["clone", "--bare", "--no-hardlinks", "--quiet", "--no-tags", "--single-branch"] }
let(:fail_clone_result) { double(Process::Status, success?: false) }

it "retries without --depth when git url is http and fails" do
allow(git_proxy).to receive(:git_local).with("--version").and_return("git version 2.14.0")
allow(git_proxy).to receive(:capture).with([*base_clone_args, "--", uri, path.to_s], nil).and_return(["", "dumb http transport does not support shallow capabilities", fail_clone_result])
expect(git_proxy).to receive(:capture).with([*without_depth_arguments, "--", uri, path.to_s], nil).and_return(["", "", clone_result])

subject.checkout
end
end
end

0 comments on commit 5ef9f00

Please sign in to comment.