From f6620037ba1477d2c337d7b511f094d6d0fbb69c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 22 Dec 2022 08:20:23 +0900 Subject: Merge RubyGems-3.4.0 and Bundler-2.4.0 --- spec/bundler/lock/git_spec.rb | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'spec/bundler/lock/git_spec.rb') diff --git a/spec/bundler/lock/git_spec.rb b/spec/bundler/lock/git_spec.rb index df9d71fdd6..dfcbb645b1 100644 --- a/spec/bundler/lock/git_spec.rb +++ b/spec/bundler/lock/git_spec.rb @@ -52,6 +52,44 @@ RSpec.describe "bundle lock with git gems" do expect(err).to be_empty end + it "properly fetches a git source locked to an unreachable ref" do + # Create a commit and make it unreachable + git "checkout -b foo ", lib_path("foo-1.0") + unreachable_sha = update_git("foo").ref_for("HEAD") + git "checkout main ", lib_path("foo-1.0") + git "branch -D foo ", lib_path("foo-1.0") + + gemfile <<-G + source "#{file_uri_for(gem_repo1)}" + gem 'foo', :git => "#{lib_path("foo-1.0")}" + G + + lockfile <<-L + GIT + remote: #{lib_path("foo-1.0")} + revision: #{unreachable_sha} + specs: + foo (1.0) + + GEM + remote: #{file_uri_for(gem_repo1)}/ + specs: + + PLATFORMS + #{lockfile_platforms} + + DEPENDENCIES + foo! + + BUNDLED WITH + #{Bundler::VERSION} + L + + bundle "install" + + expect(err).to be_empty + end + it "provides correct #full_gem_path" do run <<-RUBY puts Bundler.rubygems.find_name('foo').first.full_gem_path -- cgit v1.2.3