aboutsummaryrefslogtreecommitdiff
path: root/Backend/File.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-23 02:10:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-23 02:10:59 -0400
commitc43e3b5c787050664089fa4498e660a475addcd9 (patch)
tree3da57db088d99ac43c81245c9fd605ddf2854eda /Backend/File.hs
parent12cdc96216e0c516ceeee922f9ca1568e9d4d592 (diff)
check key size when available, no matter the backend
Now that SHA and other backends can have size info, fsck should check it whenever available.
Diffstat (limited to 'Backend/File.hs')
-rw-r--r--Backend/File.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Backend/File.hs b/Backend/File.hs
index a5e243199..a6d42eabd 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -38,7 +38,7 @@ backend = Backend {
retrieveKeyFile = copyKeyFile,
removeKey = checkRemoveKey,
hasKey = inAnnex,
- fsckKey = mustProvide
+ fsckKey = checkKeyOnly
}
mustProvide :: a
@@ -172,6 +172,9 @@ checkKey a key file numcopies = do
copies_ok <- checkKeyNumCopies key file numcopies
return $ a_ok && copies_ok
+checkKeyOnly :: Key -> Maybe FilePath -> Maybe Int -> Annex Bool
+checkKeyOnly = checkKey (\_ -> return True)
+
checkKeyNumCopies :: Key -> Maybe FilePath -> Maybe Int -> Annex Bool
checkKeyNumCopies key file numcopies = do
needed <- getNumCopies numcopies