summaryrefslogtreecommitdiff
path: root/Command/Add.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-01-20 19:35:50 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-01-20 19:35:50 -0400
commitcb50de905ca5b63cbb972cf587f74ff563b2573b (patch)
tree6ecedc8ac397a6912133cca6c4fc8e023dc84807 /Command/Add.hs
parent745525e80bb6915f3eb63554de9b735b75991f7d (diff)
on second thought, InodeCache should use getFileSize
This is necessary for interop between inode caches created on unix and windows. Which is more important than supporting inodecaches for large keys with the wrong size, which are broken anyway. There should be no slowdown from this change, except on Windows.
Diffstat (limited to 'Command/Add.hs')
-rw-r--r--Command/Add.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Add.hs b/Command/Add.hs
index 519dad6e4..d745000f8 100644
--- a/Command/Add.hs
+++ b/Command/Add.hs
@@ -160,8 +160,9 @@ ingest Nothing = return (Nothing, Nothing)
ingest (Just source) = withTSDelta $ \delta -> do
backend <- chooseBackend $ keyFilename source
k <- genKey source backend
- ms <- liftIO $ catchMaybeIO $ getFileStatus $ contentLocation source
- mcache <- maybe (pure Nothing) (liftIO . toInodeCache delta) ms
+ let src = contentLocation source
+ ms <- liftIO $ catchMaybeIO $ getFileStatus src
+ mcache <- maybe (pure Nothing) (liftIO . toInodeCache delta src) ms
case (mcache, inodeCache source) of
(_, Nothing) -> go k mcache ms
(Just newc, Just c) | compareStrong c newc -> go k mcache ms