From eedebb0057b4d0fc7d0d13214d8f5e3890034374 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Dec 2010 15:01:04 -0400 Subject: [PATCH] Support upgrading from a v0 annex with nothing in it. --- Upgrade.hs | 10 +++++++--- debian/changelog | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Upgrade.hs b/Upgrade.hs index 52ecfa07d7..204e2d555f 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 $ diff --git a/debian/changelog b/debian/changelog index 70d375f30e..ae6c3f0469 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ git-annex (0.14) UNRELEASED; urgency=low * Bugfix to git annex unused in a repository with nothing yet annexed. + * Support upgrading from a v0 annex with nothing in it. -- Joey Hess Mon, 20 Dec 2010 14:54:49 -0400