summaryrefslogtreecommitdiff
path: root/Upgrade.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-12-20 15:01:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-12-20 15:01:04 -0400
commiteedebb0057b4d0fc7d0d13214d8f5e3890034374 (patch)
treec4be01791e05d3099c4722878e4746ee4183ee23 /Upgrade.hs
parentc4a357d5d13e6c2f09ee98ee6ef8b18104e5d167 (diff)
Support upgrading from a v0 annex with nothing in it.
Diffstat (limited to 'Upgrade.hs')
-rw-r--r--Upgrade.hs10
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 $