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.
This commit is contained in:
parent
12cdc96216
commit
c43e3b5c78
3 changed files with 43 additions and 29 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue