Skip to content

Commit

Permalink
Revert hack for incorrect error when rename across devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed May 13, 2018
1 parent 44bd17d commit da420c9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions lib/ruby/stdlib/fileutils.rb
Expand Up @@ -469,7 +469,7 @@ def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
end
begin
File.rename s, d
rescue *MV_RESCUES
rescue EXDEV
copy_entry s, d, true
if secure
remove_entry_secure s, force
Expand All @@ -484,15 +484,6 @@ def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
end
module_function :mv

# JRuby raises EACCES because JDK reports errors differently
MV_RESCUES = begin
if RUBY_ENGINE == 'jruby'
[Errno::EXDEV, Errno::EACCES]
else
[Errno::EXDEV]
end
end

alias move mv
module_function :move

Expand Down

0 comments on commit da420c9

Please sign in to comment.