diff options
author | Joey Hess <joey@kitenet.net> | 2010-12-02 21:26:37 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-12-02 21:26:37 -0400 |
commit | 71d60eb87a492a9561f7142cc897ff5961c21e25 (patch) | |
tree | 1baa08aa85fc1734e54f2b291e0beaf407582acf /Core.hs | |
parent | 83a87a522903e18a16ae19e1b741ab4e1f2b95a6 (diff) |
robustness fix
don't crash if an object directory does not contain a file
Diffstat (limited to 'Core.hs')
-rw-r--r-- | Core.hs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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] |