make retrieveKeyFile and retrieveKeyFileCheap throw exceptions
Converted retrieveKeyFileCheap to a Maybe, to avoid needing to throw a exception when a remote doesn't support it.
This commit is contained in:
parent
a6adea4aaf
commit
d9c7f81ba4
32 changed files with 247 additions and 245 deletions
|
@ -59,8 +59,8 @@ gen r u rc gc rs = do
|
|||
, cost = cst
|
||||
, name = Git.repoDescribe r
|
||||
, storeKey = storeKeyDummy
|
||||
, retrieveKeyFile = retreiveKeyFileDummy
|
||||
, retrieveKeyFileCheap = retrieveCheap hooktype
|
||||
, retrieveKeyFile = retrieveKeyFileDummy
|
||||
, retrieveKeyFileCheap = Nothing
|
||||
-- A hook could use http and be vulnerable to
|
||||
-- redirect to file:// attacks, etc.
|
||||
, retrievalSecurityPolicy = mkRetrievalVerifiableKeysSecure gc
|
||||
|
@ -162,9 +162,6 @@ retrieve h = fileRetriever $ \d k _p ->
|
|||
unlessM (runHook' h "retrieve" k (Just d) $ return True) $
|
||||
giveup "failed to retrieve content"
|
||||
|
||||
retrieveCheap :: HookName -> Key -> AssociatedFile -> FilePath -> Annex Bool
|
||||
retrieveCheap _ _ _ _ = return False
|
||||
|
||||
remove :: HookName -> Remover
|
||||
remove h k = runHook' h "remove" k Nothing $ return True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue