diff --git a/bundler/lib/bundler/source/git/git_proxy.rb b/bundler/lib/bundler/source/git/git_proxy.rb index 5dc1c8de32d7..7ac47044b30c 100644 --- a/bundler/lib/bundler/source/git/git_proxy.rb +++ b/bundler/lib/bundler/source/git/git_proxy.rb @@ -118,7 +118,7 @@ def copy_to(destination, submodules = false) git_retry %(clone --no-checkout --quiet "#{path}" "#{destination}") File.chmod(((File.stat(destination).mode | 0o777) & ~File.umask), destination) rescue Errno::EEXIST => e - file_path = e.message[%r{.*?(/.*)}, 1] + file_path = e.message[%r{.*?((?:[a-zA-Z]:)?/.*)}, 1] raise GitError, "Bundler could not install a gem because it needs to " \ "create a directory, but a file exists - #{file_path}. Please delete " \ "this file and try again." 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)