From 46d6b01f79e5c1e2b1d295ec53a040375fb1d753 Mon Sep 17 00:00:00 2001 From: Antonio Cunei Date: Wed, 13 Dec 2017 15:09:52 +0100 Subject: [PATCH] Use copyLastModified() in Sync.scala It turns out the code in Sync.scala activiely tries to transfer the invalid modifed time of non-existent files in the source directory over the time of the target file, which may or may not exist. In case it exists, the modification time is set to January 1, 1970. This is arguably a bug in Sync, which should be adjusted to better handle mappings with source files that do not exist. For now, however, we preserve the current behavior, using the deprecated copyLastModified(). --- main-actions/src/main/scala/sbt/Sync.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main-actions/src/main/scala/sbt/Sync.scala b/main-actions/src/main/scala/sbt/Sync.scala index 17f169e47..ec2eb73e3 100644 --- a/main-actions/src/main/scala/sbt/Sync.scala +++ b/main-actions/src/main/scala/sbt/Sync.scala @@ -66,7 +66,7 @@ object Sync { else if (!target.exists) // we don't want to update the last modified time of an existing directory { IO.createDirectory(target) - IO.copyModifiedTime(source, target) + IO.copyLastModified(source, target) } def noDuplicateTargets(relation: Relation[File, File]): Unit = {