Permalink
Browse files

Merge pull request #5427 from jekyll/don-t-utime-if-symlink

Merge pull request 5427
  • Loading branch information...
jekyllbot committed Sep 29, 2016
2 parents b38ac5d + 8e91263 commit f0574e047ec50359ce906ea8143713d7f1dd1bb8
Showing with 12 additions and 1 deletion.
  1. +4 −1 lib/jekyll/static_file.rb
  2. +8 −0 test/test_static_file.rb
@@ -146,7 +146,10 @@ def copy_file(dest_path)
else
FileUtils.copy_entry(path, dest_path)
end
File.utime(self.class.mtimes[path], self.class.mtimes[path], dest_path)
unless File.symlink?(dest_path)
File.utime(self.class.mtimes[path], self.class.mtimes[path], dest_path)
end
end
end
end
View
@@ -112,6 +112,14 @@ def setup_static_file_with_defaults(base, dir, name, defaults)
assert_equal Time.new.to_i, @static_file.mtime
end
should "only set modified time if not a symlink" do
expect(File).to receive(:symlink?).and_return(true)
expect(File).not_to receive(:utime)
@static_file.write(dest_dir)
allow(File).to receive(:symlink?).and_call_original
end
should "known if the source path is modified, when it is" do
sleep 1
modify_dummy_file(@filename)

0 comments on commit f0574e0

Please sign in to comment.