Bugfix to git annex unused in a repository with nothing yet annexed.

This commit is contained in:
Joey Hess 2010-12-20 14:57:43 -04:00
parent ea70873b11
commit c4a357d5d1
3 changed files with 15 additions and 3 deletions

10
Core.hs
View file

@ -185,9 +185,13 @@ getKeysPresent = do
getKeysPresent' $ annexObjectDir g getKeysPresent' $ annexObjectDir g
getKeysPresent' :: FilePath -> Annex [Key] getKeysPresent' :: FilePath -> Annex [Key]
getKeysPresent' dir = do getKeysPresent' dir = do
contents <- liftIO $ getDirectoryContents dir exists <- liftIO $ doesDirectoryExist dir
files <- liftIO $ filterM present contents if (not exists)
return $ map fileKey files then return []
else do
contents <- liftIO $ getDirectoryContents dir
files <- liftIO $ filterM present contents
return $ map fileKey files
where where
present d = do present d = do
result <- try $ result <- try $

6
debian/changelog vendored
View file

@ -1,3 +1,9 @@
git-annex (0.14) UNRELEASED; urgency=low
* Bugfix to git annex unused in a repository with nothing yet annexed.
-- Joey Hess <joeyh@debian.org> Mon, 20 Dec 2010 14:54:49 -0400
git-annex (0.13) unstable; urgency=low git-annex (0.13) unstable; urgency=low
* Makefile: Install man page and html (when built). * Makefile: Install man page and html (when built).

View file

@ -11,3 +11,5 @@ The ``git annex unused`` command fails on a git-annex repository, if there are n
This can give a user (especially one that wants to try out simple commands with his newly created repo) the impression that something is wrong, while it is not. I'd expect the program either to show the same message ``git annex unused`` shows when everything is ok (since it is, or should be). This can give a user (especially one that wants to try out simple commands with his newly created repo) the impression that something is wrong, while it is not. I'd expect the program either to show the same message ``git annex unused`` shows when everything is ok (since it is, or should be).
This can be a bug in the ``unused`` subcommand (that fails to accept the absence of an objects directory) or in the ``init`` subcommand (that fails to create it). This can be a bug in the ``unused`` subcommand (that fails to accept the absence of an objects directory) or in the ``init`` subcommand (that fails to create it).
> [[fixed|done]] --[[Joey]]