summaryrefslogtreecommitdiff
path: root/Commands.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-10-14 18:48:21 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-10-14 18:48:21 -0400
commitc4959fee47f168857998dea6d11395158251158d (patch)
treece18cde75576de98a0795e8f126df27ae0f77385 /Commands.hs
parent467c4b2751921818f86561d85b0927254e48d956 (diff)
bugfix
Diffstat (limited to 'Commands.hs')
-rw-r--r--Commands.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/Commands.hs b/Commands.hs
index 58d88aa3b..ce8f00fd6 100644
--- a/Commands.hs
+++ b/Commands.hs
@@ -200,9 +200,9 @@ requireEnoughCopies key = do
findcopies n (r:rs) bad = do
result <- liftIO $ try $ haskey r
case (result) of
- Right True -> do
- findcopies (n-1) rs bad
- Left _ -> findcopies n rs (r:bad)
+ Right True -> findcopies (n-1) rs bad
+ Right False -> findcopies n rs bad
+ Left _ -> findcopies n rs (r:bad)
haskey r = do
-- To check if a remote has a key, construct a new
-- Annex monad and query its backend.
@@ -211,9 +211,11 @@ requireEnoughCopies key = do
return result
die bad =
error $ "I failed to find enough other copies of: " ++
- (keyFile key) ++ "\n" ++
- "I was unable to access these remotes: " ++
- (Remotes.list bad) ++ unsafe
+ (keyFile key) ++
+ (if (0 /= length bad) then listbad bad else "")
+ ++ unsafe
+ listbad bad = "\nI was unable to access these remotes: " ++
+ (Remotes.list bad)
unsafe = "\n -- According to the " ++ config ++
" setting, it is not safe to remove it!"
config = "annex.numcopies"