diff options
author | Joey Hess <joey@kitenet.net> | 2013-09-25 16:07:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-09-25 16:07:11 -0400 |
commit | 8f29f17005f427f8c671656e90ba1610862313fb (patch) | |
tree | dd59c640d6349f8d64a80d94357e78daed38e433 /Assistant | |
parent | 732d9aa3a0ae7233a74e412647cbfae856b67708 (diff) |
add, import, assistant: Better preserve the mtime of symlinks, when when adding content that gets deduplicated.
Note that this turned out to remove a syscall, not add any expense.
Otherwise, I would not have done it.
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Threads/Committer.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index be3bc3c84..445f4753b 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -319,10 +319,10 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do add change@(InProcessAddChange { keySource = ks }) = catchDefaultIO Nothing <~> do sanitycheck ks $ do - key <- liftAnnex $ do + (mkey, mcache) <- liftAnnex $ do showStart "add" $ keyFilename ks Command.Add.ingest $ Just ks - maybe (failedingest change) (done change $ keyFilename ks) key + maybe (failedingest change) (done change mcache $ keyFilename ks) mkey add _ = return Nothing {- In direct mode, avoid overhead of re-injesting a renamed @@ -349,7 +349,7 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do fastadd change key = do let source = keySource change liftAnnex $ Command.Add.finishIngestDirect key source - done change (keyFilename source) key + done change Nothing (keyFilename source) key removedKeysMap :: InodeComparisonType -> [Change] -> Annex (M.Map InodeCacheKey Key) removedKeysMap ct l = do @@ -365,11 +365,11 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do liftAnnex showEndFail return Nothing - done change file key = liftAnnex $ do + done change mcache file key = liftAnnex $ do logStatus key InfoPresent link <- ifM isDirect ( inRepo $ gitAnnexLink file key - , Command.Add.link file key True + , Command.Add.link file key mcache ) whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ do stageSymlink file =<< hashSymlink link |