aboutsummaryrefslogtreecommitdiff
path: root/Annex/Content
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-11 02:57:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-11 02:57:48 -0400
commita41051e59143824921a7e6e3d60bc2b50881d4b4 (patch)
treefcf1f3cadedd053b2ee2206d600350a763526228 /Annex/Content
parent9b5b4d3df90eee8e6a9a25bda22f41e82adeaf18 (diff)
remove Eq instance for InodeCache
There are two types of equality here, and which one is right varies, so this forces me to consider and choose between them. Based on this, I learned that the commit in git anex sync was always doing a strong comparison, even when in a repository where the inodes had changed. Fixed that.
Diffstat (limited to 'Annex/Content')
-rw-r--r--Annex/Content/Direct.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index b0d549fc6..164cb64a4 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -13,6 +13,7 @@ module Annex.Content.Direct (
recordedInodeCache,
updateInodeCache,
writeInodeCache,
+ compareInodeCaches,
sameInodeCache,
sameFileStatus,
removeInodeCache,
@@ -146,7 +147,7 @@ sameFileStatus key status = do
{- If the inodes have changed, only the size and mtime are compared. -}
compareInodeCaches :: InodeCache -> InodeCache -> Annex Bool
compareInodeCaches x y
- | x == y = return True
+ | x `compareStrong` y = return True
| otherwise = ifM inodesChanged
( return $ compareWeak x y
, return False
@@ -167,7 +168,7 @@ inodesChanged = maybe calc return =<< Annex.getState Annex.inodeschanged
=<< fromRepo gitAnnexInodeSentinal
scached <- readInodeSentinalFile
let changed = case (scache, scached) of
- (Just c1, Just c2) -> c1 /= c2
+ (Just c1, Just c2) -> not $ compareStrong c1 c2
_ -> True
Annex.changeState $ \s -> s { Annex.inodeschanged = Just changed }
return changed