summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content/Direct.hs5
-rw-r--r--Annex/Direct.hs6
2 files changed, 7 insertions, 4 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
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index c6f12a7b8..1bebb2cb7 100644
--- a/Annex/Direct.hs
+++ b/Annex/Direct.hs
@@ -51,8 +51,10 @@ stageDirect = do
- modified, so compare the cache to see if
- it really was. -}
oldcache <- recordedInodeCache key
- when (oldcache /= Just cache) $
- modifiedannexed file key cache
+ case oldcache of
+ Nothing -> modifiedannexed file key cache
+ Just c -> unlessM (compareInodeCaches c cache) $
+ modifiedannexed file key cache
(Just key, Nothing, _) -> deletedannexed file key
(Nothing, Nothing, _) -> deletegit file
(_, Just _, _) -> addgit file