aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-12-20 14:57:43 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-12-20 14:57:43 -0400
commitc4a357d5d13e6c2f09ee98ee6ef8b18104e5d167 (patch)
tree44d37ce34184a4cdf30bccddc9104daaf4a8171a
parentea70873b112c9a1a4471bbd263001975e69e6bdf (diff)
Bugfix to git annex unused in a repository with nothing yet annexed.
-rw-r--r--Core.hs10
-rw-r--r--debian/changelog6
-rw-r--r--doc/bugs/git_annex_unused_failes_on_empty_repository.mdwn2
3 files changed, 15 insertions, 3 deletions
diff --git a/Core.hs b/Core.hs
index e3702044e..9da4f3f2e 100644
--- a/Core.hs
+++ b/Core.hs
@@ -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 $
diff --git a/debian/changelog b/debian/changelog
index af63601ba..70d375f30 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
* Makefile: Install man page and html (when built).
diff --git a/doc/bugs/git_annex_unused_failes_on_empty_repository.mdwn b/doc/bugs/git_annex_unused_failes_on_empty_repository.mdwn
index 9be98104a..05aa69572 100644
--- a/doc/bugs/git_annex_unused_failes_on_empty_repository.mdwn
+++ b/doc/bugs/git_annex_unused_failes_on_empty_repository.mdwn
@@ -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 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]]