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
|
return $ map fileKey files
|
||||||
where
|
where
|
||||||
present d = do
|
present d = do
|
||||||
s <- getFileStatus $ dir ++ "/" ++ d ++ "/"
|
result <- try $
|
||||||
++ takeFileName d
|
getFileStatus $ dir ++ "/" ++ d ++ "/" ++ takeFileName d
|
||||||
return $ isRegularFile s
|
case result of
|
||||||
|
Right s -> return $ isRegularFile s
|
||||||
|
Left _ -> return False
|
||||||
|
|
||||||
{- List of keys referenced by symlinks in the git repo. -}
|
{- List of keys referenced by symlinks in the git repo. -}
|
||||||
getKeysReferenced :: Annex [Key]
|
getKeysReferenced :: Annex [Key]
|
||||||
|
|
Loading…
Reference in a new issue