Merge pull request #5427 from jekyll/don-t-utime-if-symlink
Merge pull request 5427
This commit is contained in:
commit
f0574e047e
|
@ -146,7 +146,10 @@ module Jekyll
|
|||
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
|
||||
|
|
|
@ -112,6 +112,14 @@ class TestStaticFile < JekyllUnitTest
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue