Support upgrading from a v0 annex with nothing in it.

This commit is contained in:
Joey Hess 2010-12-20 15:01:04 -04:00
parent c4a357d5d1
commit eedebb0057
2 changed files with 8 additions and 3 deletions

View file

@ -67,9 +67,13 @@ upgradeFrom0 = do
getKeysPresent0' :: FilePath -> Annex [Key]
getKeysPresent0' dir = do
contents <- liftIO $ getDirectoryContents dir
files <- liftIO $ filterM present contents
return $ map fileKey files
exists <- liftIO $ doesDirectoryExist dir
if (not exists)
then return []
else do
contents <- liftIO $ getDirectoryContents dir
files <- liftIO $ filterM present contents
return $ map fileKey files
where
present d = do
result <- try $