summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs7
-rw-r--r--Command/Find.hs1
-rw-r--r--Command/PreCommit.hs1
3 files changed, 7 insertions, 2 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 26e7fa258..09fff7cff 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -18,6 +18,7 @@ import Types
import Content
import Messages
import Utility
+import Touch
command :: [Command]
command = [Command "add" paramPath seek "add files to annex"]
@@ -53,5 +54,11 @@ cleanup file key = do
link <- calcGitLink file key
liftIO $ createSymbolicLink link file
+
+ -- touch the symlink to have the same mtime as the file it points to
+ s <- liftIO $ getFileStatus file
+ let mtime = modificationTime s
+ _ <- liftIO $ touch file (TimeSpec mtime 0) False
+
Annex.queue "add" [Param "--"] file
return True
diff --git a/Command/Find.hs b/Command/Find.hs
index 1ca6ff1e7..3ed15c153 100644
--- a/Command/Find.hs
+++ b/Command/Find.hs
@@ -12,7 +12,6 @@ import Control.Monad.State (liftIO)
import Command
import Content
-import Messages
command :: [Command]
command = [Command "find" (paramOptional $ paramRepeating paramPath) seek
diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs
index 6f9adb79a..1465ebc61 100644
--- a/Command/PreCommit.hs
+++ b/Command/PreCommit.hs
@@ -14,7 +14,6 @@ import qualified Annex
import qualified GitRepo as Git
import qualified Command.Add
import qualified Command.Fix
-import Messages
import Utility
command :: [Command]