robustness fix
don't crash if an object directory does not contain a file
This commit is contained in:
parent
83a87a5229
commit
71d60eb87a
1 changed files with 5 additions and 3 deletions
8
Core.hs
8
Core.hs
|
@ -190,9 +190,11 @@ getKeysPresent' dir = do
|
|||
return $ map fileKey files
|
||||
where
|
||||
present d = do
|
||||
s <- getFileStatus $ dir ++ "/" ++ d ++ "/"
|
||||
++ takeFileName d
|
||||
return $ isRegularFile s
|
||||
result <- try $
|
||||
getFileStatus $ dir ++ "/" ++ d ++ "/" ++ takeFileName d
|
||||
case result of
|
||||
Right s -> return $ isRegularFile s
|
||||
Left _ -> return False
|
||||
|
||||
{- List of keys referenced by symlinks in the git repo. -}
|
||||
getKeysReferenced :: Annex [Key]
|
||||
|
|
Loading…
Reference in a new issue