fix key checking when a directory special remote's directory is missing
The best thing to do in this case is return Left, so that anything that tries to access it will fail.
This commit is contained in:
parent
93be3296fc
commit
0d89b65bfc
1 changed files with 8 additions and 2 deletions
|
@ -168,5 +168,11 @@ remove d k = liftIO $ do
|
|||
|
||||
checkPresent :: FilePath -> ChunkConfig -> Key -> Annex (Either String Bool)
|
||||
checkPresent d (LegacyChunks _) k = Legacy.checkPresent d locations k
|
||||
checkPresent d _ k = liftIO $ catchMsgIO $
|
||||
anyM doesFileExist (locations d k)
|
||||
checkPresent d _ k = liftIO $ do
|
||||
v <- catchMsgIO $ anyM doesFileExist (locations d k)
|
||||
case v of
|
||||
Right False -> ifM (doesDirectoryExist d)
|
||||
( return v
|
||||
, return $ Left $ "directory " ++ d ++ " is not accessible"
|
||||
)
|
||||
_ -> return v
|
||||
|
|
Loading…
Reference in a new issue