summaryrefslogtreecommitdiff
path: root/Annex/Direct.hs
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/Direct.hs
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/Direct.hs')
-rw-r--r--Annex/Direct.hs6
1 files changed, 4 insertions, 2 deletions
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