Skip to content

Commit

Permalink
Merge pull request #4039 from rubygems/fix_incorrect_error_message_on…
Browse files Browse the repository at this point in the history
…_windows

Fix incorrect error message on Windows

(cherry picked from commit 7d20043)
  • Loading branch information
deivid-rodriguez committed Dec 7, 2020
1 parent a54a868 commit 5a19266
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion bundler/lib/bundler/source/git/git_proxy.rb
Expand Up @@ -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."
Expand Down
2 changes: 0 additions & 2 deletions bundler/spec/install/gemfile/git_spec.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 5a19266

Please sign in to comment.