Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def ln_sr(src, dest, target_directory: true, force: nil, noop: nil, verbose: nil
real_ddirs = fu_split_path(File.realpath(parent))
else
destdirs ||= fu_split_path(dest)
real_ddirs ||= fu_split_path(File.realpath(dest))
real_ddirs ||= fu_split_path(File.realdirpath(dest))
end
srcdirs = fu_split_path(s)
i = fu_common_components(srcdirs, destdirs)
Expand Down
6 changes: 5 additions & 1 deletion test/fileutils/test_fileutils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,11 @@ def test_ln_sr_not_target_directory
assert_raise(Errno::EEXIST, Errno::EACCES) {
ln_sr fname, 'tmp', target_directory: false
}
assert_file.not_exist? File.join('tmp/', File.basename(fname))
dest = File.join('tmp/', File.basename(fname))
assert_file.not_exist? dest
ln_sr fname, dest, target_directory: false
assert_file.symlink?(dest)
assert_equal("../#{fname}", File.readlink(dest))
end
end if have_symlink?

Expand Down
Loading