Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect error message on Windows #4039

Merged
merged 1 commit into from Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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