summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-10-08 17:58:32 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-10-08 17:58:32 -0400
commita56d3c92b9672c6d84ac007a404b07d3eeb51025 (patch)
tree2264ea086ca39f7243deb1adfcb085551006b07d /Annex
parentd5494842274030d21356c7492e6de5969173c34d (diff)
support invalidating existing VerifiedCopys
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Content.hs5
-rw-r--r--Annex/NumCopies.hs2
2 files changed, 5 insertions, 2 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs
index e45d9ea05..d0596644e 100644
--- a/Annex/Content.hs
+++ b/Annex/Content.hs
@@ -183,7 +183,10 @@ contentLockFile key = Just <$> calcRepo (gitAnnexContentLock key)
lockContentShared :: Key -> (VerifiedCopy -> Annex a) -> Annex a
lockContentShared key a = lockContentUsing lock key $ do
u <- getUUID
- a (VerifiedCopyLock u (return ()))
+ bracketIO
+ (invalidatableVerifiedCopy VerifiedCopyLock u)
+ invalidateVerifiedCopy
+ a
where
#ifndef mingw32_HOST_OS
lock contentfile Nothing = liftIO $ tryLockShared Nothing contentfile
diff --git a/Annex/NumCopies.hs b/Annex/NumCopies.hs
index 549c72207..6b534591e 100644
--- a/Annex/NumCopies.hs
+++ b/Annex/NumCopies.hs
@@ -113,7 +113,7 @@ verifyEnoughCopies nolocmsg key need skip preverified tocheck =
| otherwise = do
haskey <- Remote.hasKey r key
case haskey of
- Right True -> helper bad missing (VerifiedCopy u:have) rs
+ Right True -> helper bad missing (mkVerifiedCopy RecentlyVerifiedCopy u : have) rs
Left _ -> helper (r:bad) missing have rs
Right False -> helper bad (u:missing) have rs
where