diff options
author | Joey Hess <joey@kitenet.net> | 2010-12-20 15:01:04 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-12-20 15:01:04 -0400 |
commit | eedebb0057b4d0fc7d0d13214d8f5e3890034374 (patch) | |
tree | c4be01791e05d3099c4722878e4746ee4183ee23 /Upgrade.hs | |
parent | c4a357d5d13e6c2f09ee98ee6ef8b18104e5d167 (diff) |
Support upgrading from a v0 annex with nothing in it.
Diffstat (limited to 'Upgrade.hs')
-rw-r--r-- | Upgrade.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Upgrade.hs b/Upgrade.hs index 52ecfa07d..204e2d555 100644 --- a/Upgrade.hs +++ b/Upgrade.hs @@ -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 $ |