diff options
author | Joey Hess <joey@kitenet.net> | 2010-12-20 14:57:43 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-12-20 14:57:43 -0400 |
commit | c4a357d5d13e6c2f09ee98ee6ef8b18104e5d167 (patch) | |
tree | 44d37ce34184a4cdf30bccddc9104daaf4a8171a /Core.hs | |
parent | ea70873b112c9a1a4471bbd263001975e69e6bdf (diff) |
Bugfix to git annex unused in a repository with nothing yet annexed.
Diffstat (limited to 'Core.hs')
-rw-r--r-- | Core.hs | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -185,9 +185,13 @@ getKeysPresent = do getKeysPresent' $ annexObjectDir g getKeysPresent' :: FilePath -> Annex [Key] getKeysPresent' 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 $ |