From e7bf85961d43e5679946abd3cd0de59278582309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Wed, 8 Feb 2023 21:03:35 +0100 Subject: [rubygems/rubygems] Restore better error message when locked ref does not exist https://github.com/rubygems/rubygems/commit/c8e024359f --- spec/bundler/lock/git_spec.rb | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'spec/bundler') diff --git a/spec/bundler/lock/git_spec.rb b/spec/bundler/lock/git_spec.rb index a633bd546e..1c1f6fa93d 100644 --- a/spec/bundler/lock/git_spec.rb +++ b/spec/bundler/lock/git_spec.rb @@ -33,6 +33,33 @@ RSpec.describe "bundle lock with git gems" do expect(err).to include("Revision bad does not exist in the repository") end + it "prints a proper error when installing a Gemfile with a locked ref that does not exist" do + lockfile <<~L + GIT + remote: #{lib_path("foo-1.0")} + revision: #{"a" * 40} + specs: + foo (1.0) + + GEM + remote: #{file_uri_for(gem_repo1)}/ + specs: + + PLATFORMS + #{lockfile_platforms} + + DEPENDENCIES + foo! + + BUNDLED WITH + #{Bundler::VERSION} + L + + bundle "install", :raise_on_error => false + + expect(err).to include("Revision #{"a" * 40} does not exist in the repository") + end + it "locks a git source to the current ref" do update_git "foo" bundle :install -- cgit v1.2.1