From ab3f8911d4595d1943e942141d065f566dac8b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 26 Oct 2020 20:58:33 +0100 Subject: [PATCH] Make printed drive letters consistent on Windows --- bundler/lib/bundler/uri_credentials_filter.rb | 2 +- bundler/spec/install/deploy_spec.rb | 10 ++-------- bundler/spec/install/gemfile/git_spec.rb | 2 -- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/bundler/lib/bundler/uri_credentials_filter.rb b/bundler/lib/bundler/uri_credentials_filter.rb index 3f49254e716a..1be104730284 100644 --- a/bundler/lib/bundler/uri_credentials_filter.rb +++ b/bundler/lib/bundler/uri_credentials_filter.rb @@ -5,7 +5,7 @@ module URICredentialsFilter module_function def credential_filtered_uri(uri_to_anonymize) - return uri_to_anonymize if uri_to_anonymize.nil? + return uri_to_anonymize if uri_to_anonymize.nil? || File.exist?(uri_to_anonymize) uri = uri_to_anonymize.dup if uri.is_a?(String) require_relative "vendored_uri" diff --git a/bundler/spec/install/deploy_spec.rb b/bundler/spec/install/deploy_spec.rb index 441daabe72ac..357f4512f17a 100644 --- a/bundler/spec/install/deploy_spec.rb +++ b/bundler/spec/install/deploy_spec.rb @@ -361,10 +361,7 @@ bundle "config --local deployment true" bundle :install, :raise_on_error => false expect(err).to include("deployment mode") - # The drive letter of the Windows environment is fragile value in GitHub Actions - unless Gem.win_platform? - expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}") - end + expect(err).to include("You have deleted from the Gemfile:\n* source: #{lib_path("rack-1.0")} (at master@#{revision_for(lib_path("rack-1.0"))[0..6]}") expect(err).not_to include("You have added to the Gemfile") expect(err).not_to include("You have changed in the Gemfile") end @@ -388,10 +385,7 @@ bundle "config --local deployment true" bundle :install, :raise_on_error => false expect(err).to include("deployment mode") - # The drive letter of the Windows environment is fragile value in GitHub Actions - unless Gem.win_platform? - expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`") - end + expect(err).to include("You have changed in the Gemfile:\n* rack from `no specified source` to `#{lib_path("rack")} (at master@#{revision_for(lib_path("rack"))[0..6]})`") expect(err).not_to include("You have added to the Gemfile") expect(err).not_to include("You have deleted from the Gemfile") end diff --git a/bundler/spec/install/gemfile/git_spec.rb b/bundler/spec/install/gemfile/git_spec.rb index a70fb18c45c6..3c6a4aa5905b 100644 --- a/bundler/spec/install/gemfile/git_spec.rb +++ b/bundler/spec/install/gemfile/git_spec.rb @@ -933,8 +933,6 @@ end it "prints a friendly error if a file blocks the git repo" do - skip "drive letter is not detected correctly in error message" if Gem.win_platform? - build_git "foo" FileUtils.mkdir_p(default_bundle_path)