From cb50de905ca5b63cbb972cf587f74ff563b2573b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Jan 2015 19:35:50 -0400 Subject: 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. --- Command/Add.hs | 5 +++-- Command/Status.hs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'Command') 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 diff --git a/Command/Status.hs b/Command/Status.hs index 578538ca7..f49684258 100644 --- a/Command/Status.hs +++ b/Command/Status.hs @@ -70,7 +70,7 @@ statusDirect f = checkstatus =<< liftIO (catchMaybeIO $ getFileStatus f) | not (isSymbolicLink s) = checkkey s =<< catKeyFile f | otherwise = Just <$> checkNew f - checkkey s (Just k) = ifM (sameFileStatus k s) + checkkey s (Just k) = ifM (sameFileStatus k f s) ( return Nothing , return $ Just ModifiedFile ) -- cgit v1.2.3