summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs7
1 files changed, 7 insertions, 0 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