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 | |
parent | c4a357d5d13e6c2f09ee98ee6ef8b18104e5d167 (diff) |
Support upgrading from a v0 annex with nothing in it.
-rw-r--r-- | Upgrade.hs | 10 | ||||
-rw-r--r-- | debian/changelog | 1 |
2 files changed, 8 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 $ diff --git a/debian/changelog b/debian/changelog index 70d375f30..ae6c3f046 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 <joeyh@debian.org> Mon, 20 Dec 2010 14:54:49 -0400 |