summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-24 14:41:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-24 14:41:33 -0400
commit820750d37839e72f449d364224d23f7035d23e2c (patch)
tree3d1f87db8f2b9e99e9a5cb4074e1f173d0fb2ee7 /Command
parentd56f245b212d6a9ec88ad9d69dee4f0cc22daa5d (diff)
Preserve metadata when staging a new version of an annexed file.
Performance impact: When adding a large tree of new files, this needs to do some git cat-file queries to check if any of the files already existed and might need a metadata copy. I tried a benchmark in a copy of my sound repository (so there was already a significant git tree to check against. Adding 10000 small files, with a cold cache: before: 1m48.539s after: 1m52.791s So, impact is 0.0004 seconds per file added. Which seems acceptable, so did not add some kind of configuration to enable/disable this. This commit was sponsored by Lisa Feilen.
Diffstat (limited to 'Command')
-rw-r--r--Command/Add.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 0906ae531..662ce4242 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -161,14 +161,14 @@ ingest (Just source) = do
goindirect (Just (key, _)) mcache ms = do
catchAnnex (moveAnnex key $ contentLocation source)
(undo (keyFilename source) key)
- maybe noop (genMetaData key) ms
+ maybe noop (genMetaData key (keyFilename source)) ms
liftIO $ nukeFile $ keyFilename source
return $ (Just key, mcache)
goindirect _ _ _ = failure "failed to generate a key"
godirect (Just (key, _)) (Just cache) ms = do
addInodeCache key cache
- maybe noop (genMetaData key) ms
+ maybe noop (genMetaData key (keyFilename source)) ms
finishIngestDirect key source
return $ (Just key, Just cache)
godirect _ _ _ = failure "failed to generate a key"