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.
This commit is contained in:
Joey Hess 2015-01-20 19:35:50 -04:00
parent 467b77fd3b
commit 068aaf943b
6 changed files with 15 additions and 16 deletions

View file

@ -174,10 +174,10 @@ sameInodeCache file old = go =<< withTSDelta (liftIO . genInodeCache file)
go (Just curr) = elemInodeCaches curr old
{- Checks if a FileStatus matches the recorded InodeCache of a file. -}
sameFileStatus :: Key -> FileStatus -> Annex Bool
sameFileStatus key status = do
sameFileStatus :: Key -> FilePath -> FileStatus -> Annex Bool
sameFileStatus key f status = do
old <- recordedInodeCache key
curr <- withTSDelta $ \delta -> liftIO $ toInodeCache delta status
curr <- withTSDelta $ \delta -> liftIO $ toInodeCache delta f status
case (old, curr) of
(_, Just c) -> elemInodeCaches c old
([], Nothing) -> return True